Skip to content

Commit cf7b2ae

Browse files
andreas-schwabpalmer-dabbelt
authored andcommitted
riscv: return -ENOSYS for syscall -1
Properly return -ENOSYS for syscall -1 instead of leaving the return value uninitialized. This fixes the strace teststuite. Fixes: 5340627 ("riscv: add support for SECCOMP and SECCOMP_FILTER") Cc: stable@vger.kernel.org Signed-off-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Tycho Andersen <tycho@tycho.pizza> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent e71ba94 commit cf7b2ae

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎arch/riscv/kernel/entry.S‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,7 @@ check_syscall_nr:
186186
* Syscall number held in a7.
187187
* If syscall number is above allowed value, redirect to ni_syscall.
188188
*/
189-
bge a7, t0, 1f
190-
/*
191-
* Check if syscall is rejected by tracer, i.e., a7 == -1.
192-
* If yes, we pretend it was executed.
193-
*/
194-
li t1, -1
195-
beq a7, t1, ret_from_syscall_rejected
196-
blt a7, t1, 1f
189+
bgeu a7, t0, 1f
197190
/* Call syscall */
198191
la s0, sys_call_table
199192
slli t0, a7, RISCV_LGPTR

0 commit comments

Comments
 (0)