linux_dsm_epyc7002/arch/arm/kernel
Will Deacon 784e0300fe rseq: Avoid infinite recursion when delivering SIGSEGV
When delivering a signal to a task that is using rseq, we call into
__rseq_handle_notify_resume() so that the registers pushed in the
sigframe are updated to reflect the state of the restartable sequence
(for example, ensuring that the signal returns to the abort handler if
necessary).

However, if the rseq management fails due to an unrecoverable fault when
accessing userspace or certain combinations of RSEQ_CS_* flags, then we
will attempt to deliver a SIGSEGV. This has the potential for infinite
recursion if the rseq code continuously fails on signal delivery.

Avoid this problem by using force_sigsegv() instead of force_sig(), which
is explicitly designed to reset the SEGV handler to SIG_DFL in the case
of a recursive fault. In doing so, remove rseq_signal_deliver() from the
internal rseq API and have an optional struct ksignal * parameter to
rseq_handle_notify_resume() instead.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: peterz@infradead.org
Cc: paulmck@linux.vnet.ibm.com
Cc: boqun.feng@gmail.com
Link: https://lkml.kernel.org/r/1529664307-983-1-git-send-email-will.deacon@arm.com
2018-06-22 19:04:22 +02:00
..
.gitignore
arch_timer.c
armksyms.c
asm-offsets.c Kbuild: rename CC_STACKPROTECTOR[_STRONG] config variables 2018-06-14 12:21:18 +09:00
atags_compat.c
atags_parse.c
atags_proc.c
atags.h
bios32.c
bugs.c ARM: bugs: add support for per-processor bug checking 2018-05-31 10:39:34 +01:00
cpuidle.c
crash_dump.c
debug.S
devtree.c
dma-isa.c
dma.c proc: introduce proc_create_single{,_data} 2018-05-16 07:23:35 +02:00
early_printk.c
efi.c
elf.c
entry-armv.S Kbuild: rename CC_STACKPROTECTOR[_STRONG] config variables 2018-06-14 12:21:18 +09:00
entry-common.S Merge branch 'core-rseq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-10 10:17:09 -07:00
entry-ftrace.S
entry-header.S ARM: spectre-v1: fix syscall entry 2018-05-31 23:27:26 +01:00
entry-v7m.S
fiq.c
fiqasm.S
ftrace.c
head-common.S
head-inflate-data.c
head-nommu.S ARM: 8757/1: NOMMU: Support PMSAv8 MPU 2018-05-19 11:53:46 +01:00
head.S
hibernate.c
hw_breakpoint.c
hyp-stub.S
insn.c
io.c
irq.c
isa.c
iwmmxt.S
jump_label.c
kgdb.c
machine_kexec.c ARM: kexec: record parent context registers for non-crash CPUs 2018-05-19 11:35:56 +01:00
Makefile ARM: bugs: prepare processor bug infrastructure 2018-05-31 10:39:18 +01:00
module-plts.c
module.c
module.lds
opcodes.c
paravirt.c
patch.c
perf_callchain.c
perf_event_v6.c arm_pmu: simplify arm_pmu::handle_irq 2018-05-21 18:07:05 +01:00
perf_event_v7.c arm_pmu: simplify arm_pmu::handle_irq 2018-05-21 18:07:05 +01:00
perf_event_xscale.c arm_pmu: simplify arm_pmu::handle_irq 2018-05-21 18:07:05 +01:00
perf_regs.c
pj4-cp0.c
process.c Kbuild: rename CC_STACKPROTECTOR[_STRONG] config variables 2018-06-14 12:21:18 +09:00
psci_smp.c
ptrace.c
reboot.c
reboot.h
relocate_kernel.S
return_address.c
setup.c arch: remove the ARCH_PHYS_ADDR_T_64BIT config symbol 2018-05-09 06:56:33 +02:00
signal.c rseq: Avoid infinite recursion when delivering SIGSEGV 2018-06-22 19:04:22 +02:00
signal.h
sigreturn_codes.S
sleep.S
smccc-call.S
smp_scu.c
smp_tlb.c
smp_twd.c
smp.c Merge branches 'fixes', 'misc' and 'spectre' into for-linus 2018-06-05 10:03:27 +01:00
stacktrace.c
suspend.c ARM: bugs: hook processor bug checking into SMP and suspend paths 2018-05-31 10:39:29 +01:00
swp_emulate.c Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2018-06-04 15:23:48 -07:00
sys_arm.c
sys_oabi-compat.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
tcm.c
thumbee.c
time.c
topology.c
traps.c Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2018-06-04 15:23:48 -07:00
unwind.c
v7m.c
vdso.c
vmlinux-xip.lds.S ARM: 8757/1: NOMMU: Support PMSAv8 MPU 2018-05-19 11:53:46 +01:00
vmlinux.lds.h ARM: 8774/1: remove no-op macro VMLINUX_SYMBOL() 2018-05-19 11:53:46 +01:00
vmlinux.lds.S ARM: 8757/1: NOMMU: Support PMSAv8 MPU 2018-05-19 11:53:46 +01:00
xscale-cp0.c