[PATCH] riscv: Remove unnecessary path for syscall_trace
From: guoren
Date: Mon May 25 2020 - 10:18:40 EST
From: Guo Ren <guoren@xxxxxxxxxxxxxxxxx>
Obviously, there is no need to recover a0-a7 in reject path.
Previous modification is from commit af33d243 by Tycho, to
fixup seccomp reject syscall code path.
Signed-off-by: Guo Ren <guoren@xxxxxxxxxxxxxxxxx>
Cc: Tycho Andersen <tycho@xxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>
---
arch/riscv/kernel/entry.S | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
index 56d071b..ea3444d 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -306,7 +306,7 @@ work_resched:
handle_syscall_trace_enter:
move a0, sp
call do_syscall_trace_enter
- move t0, a0
+ bnez a0, ret_from_syscall_rejected
REG_L a0, PT_A0(sp)
REG_L a1, PT_A1(sp)
REG_L a2, PT_A2(sp)
@@ -315,7 +315,6 @@ handle_syscall_trace_enter:
REG_L a5, PT_A5(sp)
REG_L a6, PT_A6(sp)
REG_L a7, PT_A7(sp)
- bnez t0, ret_from_syscall_rejected
j check_syscall_nr
handle_syscall_trace_exit:
move a0, sp
--
2.7.4