patch-2.4.0-test2 linux/include/asm-ppc/uaccess.h
Next file: linux/include/asm-s390/pgtable.h
Previous file: linux/include/asm-ppc/system.h
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
Mon Jun 19 17:59:37 2000
- Orig file:
v2.4.0-test1/linux/include/asm-ppc/uaccess.h
- Orig date:
Fri Oct 15 15:25:14 1999
diff -u --recursive --new-file v2.4.0-test1/linux/include/asm-ppc/uaccess.h linux/include/asm-ppc/uaccess.h
@@ -211,16 +211,28 @@
extern inline unsigned long
copy_from_user(void *to, const void *from, unsigned long n)
{
+ unsigned long over;
+
if (access_ok(VERIFY_READ, from, n))
return __copy_tofrom_user(to, from, n);
+ if ((unsigned long)from < TASK_SIZE) {
+ over = (unsigned long)from + n - TASK_SIZE;
+ return __copy_tofrom_user(to, from, n - over) + over;
+ }
return n;
}
extern inline unsigned long
copy_to_user(void *to, const void *from, unsigned long n)
{
+ unsigned long over;
+
if (access_ok(VERIFY_WRITE, to, n))
return __copy_tofrom_user(to, from, n);
+ if ((unsigned long)to < TASK_SIZE) {
+ over = (unsigned long)to + n - TASK_SIZE;
+ return __copy_tofrom_user(to, from, n - over) + over;
+ }
return n;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)