diff options
| author | Paul Mackerras <paulus@samba.org> | 2002-06-26 08:04:37 -0400 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2002-06-26 08:04:37 -0400 |
| commit | bd028ecb2f3e854c54f147d335658a4106912354 (patch) | |
| tree | b47f0d3a33e6f72346e42815c5351e0c4128a649 /include | |
| parent | 9a30d64bfc32b7fa8eeab6d21ae286d530583f4d (diff) | |
PPC32: Fixes for bugs in exception handling in copy_to_user and clear_user.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-ppc/uaccess.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index 21462ee88b4b..0087efbb0d6a 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.uaccess.h 1.8 09/11/01 18:10:06 paulus + * BK Id: %F% %I% %G% %U% %#% */ #ifdef __KERNEL__ #ifndef _PPC_UACCESS_H @@ -272,7 +272,11 @@ clear_user(void *addr, unsigned long size) { if (access_ok(VERIFY_WRITE, addr, size)) return __clear_user(addr, size); - return size? -EFAULT: 0; + if ((unsigned long)addr < TASK_SIZE) { + unsigned long over = (unsigned long)addr + size - TASK_SIZE; + return __clear_user(addr, size - over) + over; + } + return size; } extern int __strncpy_from_user(char *dst, const char *src, long count); |
