Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95138
b: refs/heads/master
c: 2e2ba22
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 30, 2008
1 parent ca9f295 commit f5ec98b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53c30337f2c61aff6eecf2a446e839641172f9bd
refs/heads/master: 2e2ba22ea4fd4bb85f0fa37c521066db6775cbef
24 changes: 19 additions & 5 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ static int rm_from_queue(unsigned long mask, struct sigpending *s)
static int check_kill_permission(int sig, struct siginfo *info,
struct task_struct *t)
{
struct pid *sid;
int error;

if (!valid_signal(sig))
Expand All @@ -545,11 +546,24 @@ static int check_kill_permission(int sig, struct siginfo *info,
if (error)
return error;

if (((sig != SIGCONT) || (task_session_nr(current) != task_session_nr(t)))
&& (current->euid ^ t->suid) && (current->euid ^ t->uid)
&& (current->uid ^ t->suid) && (current->uid ^ t->uid)
&& !capable(CAP_KILL))
return -EPERM;
if ((current->euid ^ t->suid) && (current->euid ^ t->uid) &&
(current->uid ^ t->suid) && (current->uid ^ t->uid) &&
!capable(CAP_KILL)) {
switch (sig) {
case SIGCONT:
read_lock(&tasklist_lock);
sid = task_session(t);
read_unlock(&tasklist_lock);
/*
* We don't return the error if sid == NULL. The
* task was unhashed, the caller must notice this.
*/
if (!sid || sid == task_session(current))
break;
default:
return -EPERM;
}
}

return security_task_kill(t, info, sig, 0);
}
Expand Down

0 comments on commit f5ec98b

Please sign in to comment.