Impose the upper limit on signals that are allowed between kernel threads

in set[ug]id program for compatibility with Linux. Linuxthreads uses
4 signals from SIGRTMIN to SIGRTMIN+3.

Pointed out by:		rwatson
This commit is contained in:
Maxim Sobolev 2005-03-18 13:33:18 +00:00
parent 9860bab349
commit 2322a0a77d

View File

@ -1532,8 +1532,8 @@ p_cansignal(struct thread *td, struct proc *p, int signum)
* pretty safe to do since the only way to create two processes
* with the same p_leader is via rfork(2).
*/
if (signum >= SIGTHR && td->td_proc->p_leader != NULL &&
td->td_proc->p_leader == p->p_leader)
if (td->td_proc->p_leader != NULL && signum >= SIGTHR &&
signum < SIGTHR + 4 && td->td_proc->p_leader == p->p_leader)
return (0);
return (cr_cansignal(td->td_ucred, p, signum));