diff options
author | 2002-11-10 04:34:56 +0000 | |
---|---|---|
committer | 2002-11-10 04:34:56 +0000 | |
commit | 4e220424d12a3359336af215fb4166f571eeba52 (patch) | |
tree | 525d732b39a96c4e7a30a15c5765d6b9d28e138d /sys/dev/systrace.c | |
parent | fix logic. (diff) | |
download | wireguard-openbsd-4e220424d12a3359336af215fb4166f571eeba52.tar.xz wireguard-openbsd-4e220424d12a3359336af215fb4166f571eeba52.zip |
Be more careful with illegal syscall numbers.
Diffstat (limited to 'sys/dev/systrace.c')
-rw-r--r-- | sys/dev/systrace.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/systrace.c b/sys/dev/systrace.c index 2e2f1c18ab6..06612e658c4 100644 --- a/sys/dev/systrace.c +++ b/sys/dev/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.24 2002/10/25 23:22:58 fgsch Exp $ */ +/* $OpenBSD: systrace.c,v 1.25 2002/11/10 04:34:56 art Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -664,6 +664,11 @@ systrace_redirect(int code, struct proc *p, void *v, register_t *retval) return (EINVAL); } + if (code < 0 || code >= p->p_emul->e_nsysent) { + systrace_unlock(); + return (EINVAL); + } + KASSERT(strp->proc == p); fst = strp->parent; |