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

Next file: linux/include/asm-i386/fcntl.h
Previous file: linux/include/asm-alpha/posix_types.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.117/linux/include/asm-arm/uaccess.h linux/include/asm-arm/uaccess.h
@@ -60,8 +60,11 @@
 
 static __inline__ unsigned long copy_from_user(void *to, const void *from, unsigned long n)
 {
-	if (access_ok(VERIFY_READ, from, n))
+	char *end = (char *)to + n;
+	if (access_ok(VERIFY_READ, from, n)) {
 		__do_copy_from_user(to, from, n);
+		if (n) memset(end - n, 0, n);
+	}
 	return n;
 }
 

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