diff options
author | Peter Zijlstra <peterz@infradead.org> | 2019-03-01 15:24:33 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-04-03 09:36:29 +0200 |
commit | 3693ca81151eacd498675baae56abede577e8b31 (patch) | |
tree | 3a5a28311c024636af112d9d89dcdcb723ea960b /arch/x86/lib/usercopy_64.c | |
parent | i915, uaccess: Fix redundant CLAC (diff) | |
download | linux-dev-3693ca81151eacd498675baae56abede577e8b31.tar.xz linux-dev-3693ca81151eacd498675baae56abede577e8b31.zip |
x86/uaccess: Move copy_user_handle_tail() into asm
By writing the function in asm we avoid cross object code flow and
objtool no longer gets confused about a 'stray' CLAC.
Also; the asm version is actually _simpler_.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | arch/x86/lib/usercopy_64.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c index ee42bb0cbeb3..9952a01cad24 100644 --- a/arch/x86/lib/usercopy_64.c +++ b/arch/x86/lib/usercopy_64.c @@ -55,26 +55,6 @@ unsigned long clear_user(void __user *to, unsigned long n) EXPORT_SYMBOL(clear_user); /* - * Try to copy last bytes and clear the rest if needed. - * Since protection fault in copy_from/to_user is not a normal situation, - * it is not necessary to optimize tail handling. - */ -__visible unsigned long -copy_user_handle_tail(char *to, char *from, unsigned len) -{ - for (; len; --len, to++) { - char c; - - if (__get_user_nocheck(c, from++, sizeof(char))) - break; - if (__put_user_nocheck(c, to, sizeof(char))) - break; - } - clac(); - return len; -} - -/* * Similar to copy_user_handle_tail, probe for the write fault point, * but reuse __memcpy_mcsafe in case a new read error is encountered. * clac() is handled in _copy_to_iter_mcsafe(). |