summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2023-12-13 15:57:23 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2023-12-13 15:57:23 +0000
commit3ce91d347df05f82e01cbc0fb507b4d6115d25d2 (patch)
treea3805e4b25614ba51c492f7f9984a11ba5fdfc82 /sys/arch/arm
parente1a7ce4264d639195d857541152c9ad6b70e0a86 (diff)
Fix syscall number bounds check computations.
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/arm/syscall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/arm/arm/syscall.c b/sys/arch/arm/arm/syscall.c
index 3879834e2ea..0252626eeac 100644
--- a/sys/arch/arm/arm/syscall.c
+++ b/sys/arch/arm/arm/syscall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.c,v 1.27 2023/12/12 15:30:55 deraadt Exp $ */
+/* $OpenBSD: syscall.c,v 1.28 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: syscall.c,v 1.24 2003/11/14 19:03:17 scw Exp $ */
/*-
@@ -114,7 +114,7 @@ swi_handler(trapframe_t *frame)
code = frame->tf_r12;
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
nargs = callp->sy_argsize / sizeof(register_t);