patch-2.1.118 linux/include/asm-m68k/uaccess.h

Next file: linux/include/asm-ppc/uaccess.h
Previous file: linux/include/asm-i386/unistd.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.117/linux/include/asm-m68k/uaccess.h linux/include/asm-m68k/uaccess.h
@@ -712,9 +712,16 @@
 }
 
 #define copy_from_user(to, from, n)		\
+{ void *__to = (to);				\
+  void *__from = (from);			\
+  unsigned long __n = (n);			\
+  char *__end = (char *)__to + __n;		\
+  unsigned long __res =				\
 (__builtin_constant_p(n) ?			\
  __constant_copy_from_user(to, from, n) :	\
- __generic_copy_from_user(to, from, n))
+ __generic_copy_from_user(to, from, n));	\
+  if (__res) memset(__end - __res, 0, __res);	\
+  res; }
 
 #define copy_to_user(to, from, n)		\
 (__builtin_constant_p(n) ?			\

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov