From: Steve Muir Date: Tue, 11 Jan 2005 21:14:32 +0000 (+0000) Subject: Move 'lost SIGALRM' fixes to v3 branch X-Git-Tag: after-CAN_2004_1016_1017_1068-merge~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=da6e6fd0c0431bdd03d16cd0151376bd5dd2c420;p=linux-2.6.git Move 'lost SIGALRM' fixes to v3 branch --- diff --git a/kernel/itimer.c b/kernel/itimer.c index 6918cb746..5bf6c881c 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c @@ -68,7 +68,9 @@ void it_real_fn(unsigned long __data) struct task_struct * p = (struct task_struct *) __data; unsigned long interval; - send_group_sig_info(SIGALRM, SEND_SIG_PRIV, p); + if (send_group_sig_info(SIGALRM, SEND_SIG_PRIV, p)) + printk("*warning*: failed to send SIGALRM to %u\n", p->pid); + interval = p->it_real_incr; if (interval) { if (interval > (unsigned long) LONG_MAX) diff --git a/kernel/signal.c b/kernel/signal.c index b3574b096..e4282d2de 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -603,17 +603,28 @@ static int check_kill_permission(int sig, struct siginfo *info, struct task_struct *t) { int error = -EINVAL; + int user; + if (sig < 0 || sig > _NSIG) return error; + + user = (!info || + (info != SEND_SIG_PRIV && + info != SEND_SIG_FORCED && + SI_FROMUSER(info))); + error = -EPERM; - if ((!info || ((unsigned long)info != 1 && - (unsigned long)info != 2 && SI_FROMUSER(info))) - && ((sig != SIGCONT) || - (current->signal->session != t->signal->session)) + if (user && (sig != SIGCONT || + current->signal->session != t->signal->session) && (current->euid ^ t->suid) && (current->euid ^ t->uid) && (current->uid ^ t->suid) && (current->uid ^ t->uid) && !capable(CAP_KILL)) return error; + + error = -ESRCH; + if (user && !vx_check(vx_task_xid(t), VX_ADMIN|VX_IDENT)) + return error; + return security_task_kill(t, info, sig); } @@ -1055,9 +1066,6 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) unsigned long flags; int ret; - if (!vx_check(vx_task_xid(p), VX_ADMIN|VX_WATCH|VX_IDENT)) - return -ESRCH; - ret = check_kill_permission(sig, info, p); if (!ret && sig && p->sighand) { spin_lock_irqsave(&p->sighand->siglock, flags);