Signal 0 is used to check the permission for current process to signal

target one. Since r184058, linux_do_tkill() calls tdsignal() instead of
kill(), without checking for validity of supplied signal number. Prevent
panic when supplied signal is 0 by finishing work after checks.

Found and tested by:	scf
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2009-12-18 14:27:18 +00:00
parent a46a1e767d
commit 9ae781dfcf

View file

@ -565,7 +565,7 @@ linux_do_tkill(struct thread *td, l_int tgid, l_int pid, l_int signum)
AUDIT_ARG_PROCESS(p);
error = p_cansignal(td, p, signum);
if (error)
if (error != 0 || signum == 0)
goto out;
error = ESRCH;