linux/arch
Masami Hiramatsu bf094cffea x86/kprobes: Fixup return address in generic trampoline handler
In x86, the fake return address on the stack saved by
__kretprobe_trampoline() will be replaced with the real return
address after returning from trampoline_handler(). Before fixing
the return address, the real return address can be found in the
'current->kretprobe_instances'.

However, since there is a window between updating the
'current->kretprobe_instances' and fixing the address on the stack,
if an interrupt happens at that timing and the interrupt handler
does stacktrace, it may fail to unwind because it can not get
the correct return address from 'current->kretprobe_instances'.

This will eliminate that window by fixing the return address
right before updating 'current->kretprobe_instances'.

Link: https://lkml.kernel.org/r/163163057094.489837.9044470370440745866.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-09-30 21:24:08 -04:00
..
alpha alpha: enable GENERIC_PCI_IOMAP unconditionally 2021-09-19 10:37:00 -07:00
arc ARC: Add instruction_pointer_set() API 2021-09-30 21:24:07 -04:00
arm arm: kprobes: Make space for instruction pointer on stack 2021-09-30 21:24:07 -04:00
arm64 kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
csky kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
h8300 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
ia64 ia64: Add instruction_pointer_set() API 2021-09-30 21:24:07 -04:00
m68k m68k: mvme: Remove overdue #warnings in RTC handling 2021-09-13 11:19:05 +02:00
microblaze Microblaze patches for 5.15-rc1 2021-09-08 16:02:13 -07:00
mips kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
nds32 nds32/setup: remove unused memblock_region variable in setup_memory() 2021-09-08 18:45:53 -07:00
nios2 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
openrisc Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
parisc kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
powerpc kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
riscv kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
s390 kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
sh kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
sparc kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
um This pull request contains the following changes for UML: 2021-09-09 13:45:26 -07:00
x86 x86/kprobes: Fixup return address in generic trampoline handler 2021-09-30 21:24:08 -04:00
xtensa Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
.gitignore
Kconfig Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00