diff options
author | 2022-03-08 16:32:52 +0800 | |
---|---|---|
committer | 2022-03-22 14:45:14 -0700 | |
commit | 93917ad50972e6298885d81b37b6a8602eb0b188 (patch) | |
tree | e723a4f00f052273f81a94723e0664443590f1d0 /arch/riscv/kernel/signal.c | |
parent | Linux 5.17-rc1 (diff) | |
download | linux-93917ad50972e6298885d81b37b6a8602eb0b188.tar.gz linux-93917ad50972e6298885d81b37b6a8602eb0b188.tar.bz2 linux-93917ad50972e6298885d81b37b6a8602eb0b188.zip |
RISC-V: Add support for restartable sequence
Add calls to rseq_signal_deliver() and rseq_syscall() to introduce RSEQ
support.
1. Call the rseq_signal_deliver() function to fixup on the pre-signal
frame when a signal is delivered on top of a restartable sequence
critical section.
2. Check that system calls are not invoked from within rseq critical
sections by invoking rseq_signal() from ret_from_syscall(). With
CONFIG_DEBUG_RSEQ, such behavior results in termination of the
process with SIGSEGV.
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/kernel/signal.c')
-rw-r--r-- | arch/riscv/kernel/signal.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c index c2d5ecbe5526..16da3c3b53a1 100644 --- a/arch/riscv/kernel/signal.c +++ b/arch/riscv/kernel/signal.c @@ -258,6 +258,8 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) } } + rseq_signal_deliver(ksig, regs); + /* Set up the stack frame */ ret = setup_rt_frame(ksig, oldset, regs); |