Skip to content

Commit

Permalink
riscv: reject invalid syscalls below -1
Browse files Browse the repository at this point in the history
Running "stress-ng --enosys 4 -t 20 -v" showed a large number of kernel oops
with "Unable to handle kernel paging request at virtual address" message. This
happens when enosys stressor starts testing random non-valid syscalls.

I forgot to redirect any syscall below -1 to sys_ni_syscall.

With the patch kernel oops messages are gone while running stress-ng enosys
stressor.

Signed-off-by: David Abdurachmanov <[email protected]>
Fixes: 5340627 ("riscv: add support for SECCOMP and SECCOMP_FILTER")
Signed-off-by: Paul Walmsley <[email protected]>
  • Loading branch information
davidlt authored and paul-walmsley-sifive committed Dec 28, 2019
1 parent 4d47ce1 commit 556f47a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/riscv/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ check_syscall_nr:
*/
li t1, -1
beq a7, t1, ret_from_syscall_rejected
blt a7, t1, 1f
/* Call syscall */
la s0, sys_call_table
slli t0, a7, RISCV_LGPTR
Expand Down

0 comments on commit 556f47a

Please sign in to comment.