aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/x86/lib/csum-copy_64.S
diff options
context:
space:
mode:
authorJann Horn <jannh@google.com>2018-08-28 22:14:18 +0200
committerThomas Gleixner <tglx@linutronix.de>2018-09-03 15:12:09 +0200
commit75045f77f7a73e617494d7a1fcf4e9c1849cec39 (patch)
tree9d6a2482457cdf964c7882b86961ad83dde4f095 /arch/x86/lib/csum-copy_64.S
parentx86/kprobes: Stop calling fixup_exception() from kprobe_fault_handler() (diff)
downloadwireguard-linux-75045f77f7a73e617494d7a1fcf4e9c1849cec39.tar.xz
wireguard-linux-75045f77f7a73e617494d7a1fcf4e9c1849cec39.zip
x86/extable: Introduce _ASM_EXTABLE_UA for uaccess fixups
Currently, most fixups for attempting to access userspace memory are handled using _ASM_EXTABLE, which is also used for various other types of fixups (e.g. safe MSR access, IRET failures, and a bunch of other things). In order to make it possible to add special safety checks to uaccess fixups (in particular, checking whether the fault address is actually in userspace), introduce a new exception table handler ex_handler_uaccess() and wire it up to all the user access fixups (excluding ones that already use _ASM_EXTABLE_EX). Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Kees Cook <keescook@chromium.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: kernel-hardening@lists.openwall.com Cc: dvyukov@google.com Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Cc: Borislav Petkov <bp@alien8.de> Link: https://lkml.kernel.org/r/20180828201421.157735-5-jannh@google.com
Diffstat (limited to 'arch/x86/lib/csum-copy_64.S')
-rw-r--r--arch/x86/lib/csum-copy_64.S8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/lib/csum-copy_64.S b/arch/x86/lib/csum-copy_64.S
index 45a53dfe1859..a4a379e79259 100644
--- a/arch/x86/lib/csum-copy_64.S
+++ b/arch/x86/lib/csum-copy_64.S
@@ -31,14 +31,18 @@
.macro source
10:
- _ASM_EXTABLE(10b, .Lbad_source)
+ _ASM_EXTABLE_UA(10b, .Lbad_source)
.endm
.macro dest
20:
- _ASM_EXTABLE(20b, .Lbad_dest)
+ _ASM_EXTABLE_UA(20b, .Lbad_dest)
.endm
+ /*
+ * No _ASM_EXTABLE_UA; this is used for intentional prefetch on a
+ * potentially unmapped kernel address.
+ */
.macro ignore L=.Lignore
30:
_ASM_EXTABLE(30b, \L)