Skip to content

Commit

Permalink
kernel: arch_syscall_number is, in fact, signed
Browse files Browse the repository at this point in the history
Fixes #308
  • Loading branch information
klange committed Dec 31, 2024
1 parent df14a1d commit 28190ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sys/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ void syscall_handler(struct regs * r) {

long result;

if (arch_syscall_number(r) >= num_syscalls) {
if (arch_syscall_number(r) < 0 || arch_syscall_number(r) >= num_syscalls) {
result = -EINVAL;
goto _finish_syscall;
}
Expand Down

0 comments on commit 28190ad

Please sign in to comment.