https://github.com/torvalds/linux
Revision 2a418cf3f5f1caf911af288e978d61c9844b0695 authored by Andy Lutomirski on 23 February 2019, 01:17:04 UTC, committed by Borislav Petkov on 25 February 2019, 19:17:05 UTC
When calling __put_user(foo(), ptr), the __put_user() macro would call foo() in between __uaccess_begin() and __uaccess_end(). If that code were buggy, then those bugs would be run without SMAP protection. Fortunately, there seem to be few instances of the problem in the kernel. Nevertheless, __put_user() should be fixed to avoid doing this. Therefore, evaluate __put_user()'s argument before setting AC. This issue was noticed when an objtool hack by Peter Zijlstra complained about genregs_get() and I compared the assembly output to the C source. [ bp: Massage commit message and fixed up whitespace. ] Fixes: 11f1a4b9755f ("x86: reorganize SMAP handling in user space accesses") Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20190225125231.845656645@infradead.org
1 parent f331e76
Tip revision: 2a418cf3f5f1caf911af288e978d61c9844b0695 authored by Andy Lutomirski on 23 February 2019, 01:17:04 UTC
x86/uaccess: Don't leak the AC flag into __put_user() value evaluation
x86/uaccess: Don't leak the AC flag into __put_user() value evaluation
Tip revision: 2a418cf
File | Mode | Size |
---|---|---|
hvc | ||
ipwireless | ||
serdev | ||
serial | ||
vt | ||
Kconfig | -rw-r--r-- | 16.2 KB |
Makefile | -rw-r--r-- | 1.2 KB |
amiserial.c | -rw-r--r-- | 43.8 KB |
cyclades.c | -rw-r--r-- | 108.9 KB |
ehv_bytechan.c | -rw-r--r-- | 21.4 KB |
goldfish.c | -rw-r--r-- | 11.9 KB |
isicom.c | -rw-r--r-- | 40.5 KB |
mips_ejtag_fdc.c | -rw-r--r-- | 35.2 KB |
moxa.c | -rw-r--r-- | 52.1 KB |
moxa.h | -rw-r--r-- | 8.5 KB |
mxser.c | -rw-r--r-- | 70.1 KB |
mxser.h | -rw-r--r-- | 4.5 KB |
n_gsm.c | -rw-r--r-- | 78.3 KB |
n_hdlc.c | -rw-r--r-- | 27.2 KB |
n_null.c | -rw-r--r-- | 1.3 KB |
n_r3964.c | -rw-r--r-- | 31.2 KB |
n_tracerouter.c | -rw-r--r-- | 6.6 KB |
n_tracesink.c | -rw-r--r-- | 6.6 KB |
n_tracesink.h | -rw-r--r-- | 850 bytes |
n_tty.c | -rw-r--r-- | 61.6 KB |
nozomi.c | -rw-r--r-- | 46.8 KB |
pty.c | -rw-r--r-- | 24.5 KB |
rocket.c | -rw-r--r-- | 91.7 KB |
rocket.h | -rw-r--r-- | 3.8 KB |
rocket_int.h | -rw-r--r-- | 41.6 KB |
synclink.c | -rw-r--r-- | 228.7 KB |
synclink_gt.c | -rw-r--r-- | 130.9 KB |
synclinkmp.c | -rw-r--r-- | 146.1 KB |
sysrq.c | -rw-r--r-- | 26.2 KB |
tty_audit.c | -rw-r--r-- | 5.5 KB |
tty_baudrate.c | -rw-r--r-- | 6.6 KB |
tty_buffer.c | -rw-r--r-- | 16.2 KB |
tty_io.c | -rw-r--r-- | 85.3 KB |
tty_ioctl.c | -rw-r--r-- | 23.7 KB |
tty_jobctrl.c | -rw-r--r-- | 14.0 KB |
tty_ldisc.c | -rw-r--r-- | 20.2 KB |
tty_ldsem.c | -rw-r--r-- | 10.4 KB |
tty_mutex.c | -rw-r--r-- | 1.1 KB |
tty_port.c | -rw-r--r-- | 18.1 KB |
vcc.c | -rw-r--r-- | 23.2 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...