aboutsummaryrefslogtreecommitdiff
path: root/scripts/gcc-plugins/gcc-common.h
diff options
context:
space:
mode:
authorWill Deacon <[email protected]>2018-06-22 11:45:07 +0100
committerThomas Gleixner <[email protected]>2018-06-22 19:04:22 +0200
commit784e0300fe9fe4aa81bd7df9d59e138f56bb605b (patch)
tree442642dae3c8e1b50ab68460c2e7662684d9e194 /scripts/gcc-plugins/gcc-common.h
parent9a789fcfe8605417f7a1a970355f5efa4fe88c64 (diff)
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Mathieu Desnoyers <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'scripts/gcc-plugins/gcc-common.h')
0 files changed, 0 insertions, 0 deletions