提交 97433ea4 编写于 作者: K Kees Cook

s390/uaccess: Enable hardened usercopy

Enables CONFIG_HARDENED_USERCOPY checks on s390.
Signed-off-by: NKees Cook <keescook@chromium.org>
上级 9d9208a1
...@@ -122,6 +122,7 @@ config S390 ...@@ -122,6 +122,7 @@ config S390
select HAVE_ALIGNED_STRUCT_PAGE if SLUB select HAVE_ALIGNED_STRUCT_PAGE if SLUB
select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_EARLY_PFN_TO_NID select HAVE_ARCH_EARLY_PFN_TO_NID
select HAVE_ARCH_HARDENED_USERCOPY
select HAVE_ARCH_JUMP_LABEL select HAVE_ARCH_JUMP_LABEL
select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES
select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_SECCOMP_FILTER
......
...@@ -104,6 +104,7 @@ static inline unsigned long copy_from_user_mvcp(void *x, const void __user *ptr, ...@@ -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) 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)) if (static_branch_likely(&have_mvcos))
return copy_from_user_mvcos(to, from, n); return copy_from_user_mvcos(to, from, n);
return copy_from_user_mvcp(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, ...@@ -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) 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)) if (static_branch_likely(&have_mvcos))
return copy_to_user_mvcos(to, from, n); return copy_to_user_mvcos(to, from, n);
return copy_to_user_mvcs(to, from, n); return copy_to_user_mvcs(to, from, n);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册