Skip to content

Commit ae7cc57

Browse files
author
Al Viro
committed
mn10300: copy_from_user() should zero on access_ok() failure...
Cc: [email protected] Signed-off-by: Al Viro <[email protected]>
1 parent 43403ea commit ae7cc57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/mn10300/lib/usercopy.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* as published by the Free Software Foundation; either version
1010
* 2 of the Licence, or (at your option) any later version.
1111
*/
12-
#include <asm/uaccess.h>
12+
#include <linux/uaccess.h>
1313

1414
unsigned long
1515
__generic_copy_to_user(void *to, const void *from, unsigned long n)
@@ -24,6 +24,8 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n)
2424
{
2525
if (access_ok(VERIFY_READ, from, n))
2626
__copy_user_zeroing(to, from, n);
27+
else
28+
memset(to, 0, n);
2729
return n;
2830
}
2931

0 commit comments

Comments
 (0)