summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/signal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index d41b3a0e8b7e..18048ca42f0e 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1197,6 +1197,13 @@ send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
unsigned long flags;
/*
+ * Make sure legacy kernel users don't send in bad values
+ * (normal paths check this in check_kill_permission).
+ */
+ if (sig < 0 || sig > _NSIG)
+ return -EINVAL;
+
+ /*
* We need the tasklist lock even for the specific
* thread case (when we don't need to follow the group
* lists) in order to avoid races with "p->sighand"