summaryrefslogtreecommitdiffstats
path: root/arch/s390/lib/uaccess.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-07-07 11:38:39 -0700
committerKees Cook <keescook@chromium.org>2016-07-26 14:41:52 -0700
commit97433ea4fda62349bfa42089455593cbcb57e06c (patch)
tree308fd5074718b4dfa06d399c4dbf32cdde5956a3 /arch/s390/lib/uaccess.c
parent9d9208a15800f9f06f102f9aac1e8b323c3b8575 (diff)
downloadlinux-97433ea4fda62349bfa42089455593cbcb57e06c.tar.gz
linux-97433ea4fda62349bfa42089455593cbcb57e06c.tar.bz2
linux-97433ea4fda62349bfa42089455593cbcb57e06c.zip
s390/uaccess: Enable hardened usercopy
Enables CONFIG_HARDENED_USERCOPY checks on s390. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'arch/s390/lib/uaccess.c')
-rw-r--r--arch/s390/lib/uaccess.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c
index ae4de559e3a0..6986c20166f0 100644
--- a/arch/s390/lib/uaccess.c
+++ b/arch/s390/lib/uaccess.c
@@ -104,6 +104,7 @@ static inline unsigned long copy_from_user_mvcp(void *x, const void __user *ptr,
unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
{
+ check_object_size(to, n, false);
if (static_branch_likely(&have_mvcos))
return copy_from_user_mvcos(to, from, n);
return copy_from_user_mvcp(to, from, n);
@@ -177,6 +178,7 @@ static inline unsigned long copy_to_user_mvcs(void __user *ptr, const void *x,
unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
{
+ check_object_size(from, n, true);
if (static_branch_likely(&have_mvcos))
return copy_to_user_mvcos(to, from, n);
return copy_to_user_mvcs(to, from, n);