diff options
| author | 1998-12-22 07:58:44 +0000 | |
|---|---|---|
| committer | 1998-12-22 07:58:44 +0000 | |
| commit | 0b7e571a40855bcdd0d243bb25edac2a301c25e3 (patch) | |
| tree | 6fae701a127d8f1cfec11646698bdc70676de33b /sys/compat/linux/linux_signal.c | |
| parent | Correct a thinko I had when writing the comment for this code. (diff) | |
| download | wireguard-openbsd-0b7e571a40855bcdd0d243bb25edac2a301c25e3.tar.xz wireguard-openbsd-0b7e571a40855bcdd0d243bb25edac2a301c25e3.zip | |
range check signal [] conversions
Diffstat (limited to 'sys/compat/linux/linux_signal.c')
| -rw-r--r-- | sys/compat/linux/linux_signal.c | 10 |
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); } |
