Jann Horn 342db04ae7 x86/dumpstack: Don't dump kernel memory based on usermode RIP
show_opcodes() is used both for dumping kernel instructions and for dumping
user instructions. If userspace causes #PF by jumping to a kernel address,
show_opcodes() can be reached with regs->ip controlled by the user,
pointing to kernel code. Make sure that userspace can't trick us into
dumping kernel memory into dmesg.

Fixes: 7cccf0725cf7 ("x86/dumpstack: Add a show_ip() function")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: security@kernel.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180828154901.112726-1-jannh@google.com
2018-08-31 17:08:22 +02:00
..
2018-07-20 12:29:24 +10:00
2017-08-31 21:34:48 +02:00
2017-12-12 11:32:24 +01:00
2018-07-20 01:11:48 +02:00
2018-08-24 13:10:38 -07:00
2018-03-20 10:01:57 +01:00
2018-08-16 09:21:54 -07:00
2017-12-23 21:13:01 +01:00
2018-06-22 21:20:35 +02:00
2018-07-30 19:33:35 +02:00
2017-09-25 20:51:58 +02:00