]> git.baikalelectronics.ru Git - kernel.git/commit
x86/dumpstack: Dump user space code correctly again
authorThomas Gleixner <tglx@linutronix.de>
Wed, 22 Jul 2020 08:39:54 +0000 (10:39 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 22 Jul 2020 21:47:48 +0000 (23:47 +0200)
commit9a287a35cc1fadf6c4be05fcb59578ff45970213
tree4fe696be8b7938abbfa180a0dcef84e3c9616789
parent59f7f8dcfdfd0da1bdc5da2e271324844bfee211
x86/dumpstack: Dump user space code correctly again

H.J. reported that post 5.7 a segfault of a user space task does not longer
dump the Code bytes when /proc/sys/debug/exception-trace is enabled. It
prints 'Code: Bad RIP value.' instead.

This was broken by a recent change which made probe_kernel_read() reject
non-kernel addresses.

Update show_opcodes() so it retrieves user space opcodes via
copy_from_user_nmi().

Fixes: 1a55f63f1c64 ("maccess: always use strict semantics for probe_kernel_read")
Reported-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/87h7tz306w.fsf@nanos.tec.linutronix.de
arch/x86/kernel/dumpstack.c