summaryrefslogtreecommitdiff
path: root/arch/sparc/include/asm/uaccess_64.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-09-01 02:04:21 +0300
committerKees Cook <keescook@chromium.org>2016-09-06 22:17:29 +0300
commit81409e9e28058811c9ea865345e1753f8f677e44 (patch)
tree6573d95f94ea5b164035a9527a60d08650c29329 /arch/sparc/include/asm/uaccess_64.h
parente6971009a95a74f28c58bbae415c40effad1226c (diff)
downloadlinux-81409e9e28058811c9ea865345e1753f8f677e44.tar.xz
usercopy: fold builtin_const check into inline function
Instead of having each caller of check_object_size() need to remember to check for a const size parameter, move the check into check_object_size() itself. This actually matches the original implementation in PaX, though this commit cleans up the now-redundant builtin_const() calls in the various architectures. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'arch/sparc/include/asm/uaccess_64.h')
-rw-r--r--arch/sparc/include/asm/uaccess_64.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
index 8bda94fab8e8..37a315d0ddd4 100644
--- a/arch/sparc/include/asm/uaccess_64.h
+++ b/arch/sparc/include/asm/uaccess_64.h
@@ -212,8 +212,7 @@ copy_from_user(void *to, const void __user *from, unsigned long size)
{
unsigned long ret;
- if (!__builtin_constant_p(size))
- check_object_size(to, size, false);
+ check_object_size(to, size, false);
ret = ___copy_from_user(to, from, size);
if (unlikely(ret))
@@ -233,8 +232,8 @@ copy_to_user(void __user *to, const void *from, unsigned long size)
{
unsigned long ret;
- if (!__builtin_constant_p(size))
- check_object_size(from, size, true);
+ check_object_size(from, size, true);
+
ret = ___copy_to_user(to, from, size);
if (unlikely(ret))
ret = copy_to_user_fixup(to, from, size);