summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-22 07:58:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-22 07:58:47 +0000
commitf03d0e11f913894e205fa638f173aaac160b66b7 (patch)
tree9fc2fa87ce10316ddad6182e262e8d9b7e4e7432 /sys/compat/linux
parent4072d49611b7486accc513b1edbccd364a607444 (diff)
range check signal [] conversions
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_signal.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index c08ca2a4188..a96699e96ff 100644
--- a/sys/compat/linux/linux_signal.c
+++ b/sys/compat/linux/linux_signal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_signal.c,v 1.3 1997/06/02 09:42:12 deraadt Exp $ */
+/* $OpenBSD: linux_signal.c,v 1.4 1998/12/22 07:58:45 deraadt Exp $ */
/* $NetBSD: linux_signal.c,v 1.10 1996/04/04 23:51:36 christos Exp $ */
/*
@@ -247,6 +247,9 @@ linux_sys_sigaction(p, v, retval)
caddr_t sg;
int error;
+ if (SCARG(uap, signum) < 0 || SCARG(uap, signum) >= LINUX_NSIG)
+ return (EINVAL);
+
sg = stackgap_init(p->p_emul);
nlsa = SCARG(uap, nsa);
olsa = SCARG(uap, osa);
@@ -305,6 +308,9 @@ linux_sys_signal(p, v, retval)
struct sigaction *osa, *nsa, tmpsa;
int error;
+ if (SCARG(uap, sig) < 0 || SCARG(uap, sig) >= LINUX_NSIG)
+ return (EINVAL);
+
sg = stackgap_init(p->p_emul);
nsa = stackgap_alloc(&sg, sizeof *nsa);
osa = stackgap_alloc(&sg, sizeof *osa);
@@ -505,6 +511,8 @@ linux_sys_kill(p, v, retval)
struct sys_kill_args ka;
SCARG(&ka, pid) = SCARG(uap, pid);
+ if (SCARG(uap, signum) < 0 || SCARG(uap, signum) >= LINUX_NSIG)
+ return (EINVAL);
SCARG(&ka, signum) = linux_to_bsd_sig[SCARG(uap, signum)];
return sys_kill(p, &ka, retval);
}