linux-stable/arch/x86
Jann Horn 206a76a684 x86/unwind: Add hardcoded ORC entry for NULL
commit ac5ceccce5 upstream.

When the ORC unwinder is invoked for an oops caused by IP==0,
it currently has no idea what to do because there is no debug information
for the stack frame of NULL.

But if RIP is NULL, it is very likely that the last successfully executed
instruction was an indirect CALL/JMP, and it is possible to unwind out in
the same way as for the first instruction of a normal function. Hardcode
a corresponding ORC entry.

With an artificially-added NULL call in prctl_set_seccomp(), before this
patch, the trace is:

Call Trace:
 ? __x64_sys_prctl+0x402/0x680
 ? __ia32_sys_prctl+0x6e0/0x6e0
 ? __do_page_fault+0x457/0x620
 ? do_syscall_64+0x6d/0x160
 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9

After this patch, the trace looks like this:

Call Trace:
 __x64_sys_prctl+0x402/0x680
 ? __ia32_sys_prctl+0x6e0/0x6e0
 ? __do_page_fault+0x457/0x620
 do_syscall_64+0x6d/0x160
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

prctl_set_seccomp() still doesn't show up in the trace because for some
reason, tail call optimization is only disabled in builds that use the
frame pointer unwinder.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: syzbot <syzbot+ca95b2b7aef9e7cbd6ab@syzkaller.appspotmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
Link: https://lkml.kernel.org/r/20190301031201.7416-2-jannh@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-27 14:14:42 +09:00
..
boot x86/boot/compressed/64: Set EFER.LME=1 in 32-bit trampoline before returning to long mode 2019-03-13 14:02:31 -07:00
configs
crypto crypto: x86/morus - fix handling chunked inputs and MAY_SLEEP 2019-03-23 20:09:55 +01:00
entry x86/entry/64/compat: Fix stack switching for XEN PV 2019-01-31 08:14:39 +01:00
events perf/x86/intel/uncore: Fix client IMC events return huge result 2019-03-23 20:10:11 +01:00
hyperv x86/hyper-v: rename ipi_arg_{ex,non_ex} structures 2018-09-20 00:51:42 +02:00
ia32 x86/a.out: Clear the dump structure initially 2019-02-20 10:25:49 +01:00
include x86/unwind: Handle NULL pointer calls better in frame unwinder 2019-03-27 14:14:42 +09:00
kernel x86/unwind: Add hardcoded ORC entry for NULL 2019-03-27 14:14:42 +09:00
kvm KVM: nVMX: Ignore limit checks on VMX instructions using flat segments 2019-03-23 20:10:13 +01:00
lib x86/kaslr: Fix incorrect i8254 outb() parameters 2019-01-31 08:14:39 +01:00
math-emu
mm x86/mm/mem_encrypt: Fix erroneous sizeof() 2019-03-05 17:58:47 +01:00
net bpf, x32: Fix regression caused by commit 24dea04767 2018-07-26 02:51:12 +02:00
oprofile
pci x86/PCI: Fixup RTIT_BAR of Intel Denverton Trace Hub 2019-03-13 14:02:39 -07:00
platform x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls 2019-02-20 10:25:48 +01:00
power Power management updates for 4.19-rc1 2018-08-14 13:12:24 -07:00
purgatory kbuild: move bin2c back to scripts/ from scripts/basic/ 2018-07-18 01:18:05 +09:00
ras
realmode
tools x86/relocs: Add __end_rodata_aligned to S_REL 2018-08-09 20:42:07 +02:00
um um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP 2018-11-21 09:19:16 +01:00
video
xen xen: fix dom0 boot on huge systems 2019-03-23 20:09:57 +01:00
.gitignore
Kbuild
Kconfig x86/Kconfig: Select SCHED_SMT if SMP enabled 2018-12-05 19:32:02 +01:00
Kconfig.cpu
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile x86/build: Fix compiler support check for CONFIG_RETPOLINE 2018-12-19 19:19:54 +01:00
Makefile.um kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
Makefile_32.cpu