From: Andrew Morton Date: Fri, 20 Jun 2003 15:12:27 +0000 (-0700) Subject: [PATCH] ia32 copy_from_user() fix X-Git-Tag: v2.5.73~6^2~41 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=53f35f47571e6e6bc1179588bd98d6de0ad0e67b;p=history.git [PATCH] ia32 copy_from_user() fix The memset which is performed if access_ok() fails got lost in the copy_*_user() rework. Put it back. Bloats the kernel by 8k :( Also contains a few related #includes and whitespace fixlets from Joshua Kwan --- diff --git a/include/asm-h8300/uaccess.h b/include/asm-h8300/uaccess.h index 24a0b92b13ee..6996b612f4a0 100644 --- a/include/asm-h8300/uaccess.h +++ b/include/asm-h8300/uaccess.h @@ -6,6 +6,8 @@ */ #include #include +#include + #include #define VERIFY_READ 0 @@ -159,7 +161,7 @@ static inline unsigned long clear_user(void *to, unsigned long n) { memset(to, 0, n); - return(0); + return 0; } #endif /* _H8300_UACCESS_H */ diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h index 07caa21a978c..b7744806aed6 100644 --- a/include/asm-i386/uaccess.h +++ b/include/asm-i386/uaccess.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #define VERIFY_READ 0 @@ -494,6 +495,8 @@ copy_from_user(void *to, const void __user *from, unsigned long n) { if (access_ok(VERIFY_READ, from, n)) n = __copy_from_user(to, from, n); + else + memset(to, 0, n); return n; } diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index 48a4d74bc226..6ff1747b02e0 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/include/asm-m68knommu/uaccess.h @@ -6,6 +6,8 @@ */ #include #include +#include + #include #define VERIFY_READ 0 @@ -178,7 +180,7 @@ static inline unsigned long clear_user(void *to, unsigned long n) { memset(to, 0, n); - return(0); + return 0; } #endif /* _M68KNOMMU_UACCESS_H */