Skip to content

Commit e69d700

Browse files
author
Al Viro
committed
mips: copy_from_user() must zero the destination on access_ok() failure
Cc: [email protected] Signed-off-by: Al Viro <[email protected]>
1 parent 05d9d0b commit e69d700

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/mips/include/asm/uaccess.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/kernel.h>
1515
#include <linux/errno.h>
1616
#include <linux/thread_info.h>
17+
#include <linux/string.h>
1718
#include <asm/asm-eva.h>
1819

1920
/*
@@ -1170,6 +1171,8 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n);
11701171
__cu_len = __invoke_copy_from_user(__cu_to, \
11711172
__cu_from, \
11721173
__cu_len); \
1174+
} else { \
1175+
memset(__cu_to, 0, __cu_len); \
11731176
} \
11741177
} \
11751178
__cu_len; \

0 commit comments

Comments
 (0)