Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11917
b: refs/heads/master
c: 621d312
h: refs/heads/master
i:
  11915: 8d3abd9
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 31, 2005
1 parent 04b16c8 commit 906b80b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 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: b67a1b9e4bf878aa5d4b6b44cb5a251a2f425f0d
refs/heads/master: 621d31219d9a788bda924a0613048053f3f5f211
5 changes: 5 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,11 @@ extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned lon
#define SEND_SIG_PRIV ((struct siginfo *) 1)
#define SEND_SIG_FORCED ((struct siginfo *) 2)

static inline int is_si_special(const struct siginfo *info)
{
return info <= SEND_SIG_FORCED;
}

/* True if we are on the alternate signal stack. */

static inline int on_sig_stack(unsigned long sp)
Expand Down
18 changes: 7 additions & 11 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,7 @@ static int check_kill_permission(int sig, struct siginfo *info,
if (!valid_signal(sig))
return error;
error = -EPERM;
if ((info == SEND_SIG_NOINFO ||
(info != SEND_SIG_PRIV && info != SEND_SIG_FORCED
&& SI_FROMUSER(info)))
if ((info == SEND_SIG_NOINFO || (!is_si_special(info) && SI_FROMUSER(info)))
&& ((sig != SIGCONT) ||
(current->signal->session != t->signal->session))
&& (current->euid ^ t->suid) && (current->euid ^ t->uid)
Expand Down Expand Up @@ -802,7 +800,7 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
pass on the info struct. */

q = __sigqueue_alloc(t, GFP_ATOMIC, (sig < SIGRTMIN &&
(info < SEND_SIG_FORCED ||
(is_si_special(info) ||
info->si_code >= 0)));
if (q) {
list_add_tail(&q->list, &signals->list);
Expand All @@ -825,16 +823,14 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
copy_siginfo(&q->info, info);
break;
}
} else {
if (sig >= SIGRTMIN
&& info != SEND_SIG_NOINFO && info != SEND_SIG_PRIV
&& info->si_code != SI_USER)
} else if (!is_si_special(info)) {
if (sig >= SIGRTMIN && info->si_code != SI_USER)
/*
* Queue overflow, abort. We may abort if the signal was rt
* and sent by user using something other than kill().
*/
return -EAGAIN;
if ((info > SEND_SIG_PRIV) && (info->si_code == SI_TIMER))
if (info->si_code == SI_TIMER)
/*
* Set up a return to indicate that we dropped
* the signal.
Expand All @@ -860,7 +856,7 @@ specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
BUG();
assert_spin_locked(&t->sighand->siglock);

if ((info > SEND_SIG_FORCED) && (info->si_code == SI_TIMER))
if (!is_si_special(info) && (info->si_code == SI_TIMER))
/*
* Set up a return to indicate that we dropped the signal.
*/
Expand Down Expand Up @@ -1052,7 +1048,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
assert_spin_locked(&p->sighand->siglock);
handle_stop_signal(sig, p);

if ((info > SEND_SIG_FORCED) && (info->si_code == SI_TIMER))
if (!is_si_special(info) && (info->si_code == SI_TIMER))
/*
* Set up a return to indicate that we dropped the signal.
*/
Expand Down
3 changes: 1 addition & 2 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2713,8 +2713,7 @@ static int selinux_task_kill(struct task_struct *p, struct siginfo *info, int si
if (rc)
return rc;

if (info != SEND_SIG_NOINFO && (info == SEND_SIG_PRIV ||
info == SEND_SIG_FORCED || SI_FROMKERNEL(info)))
if (info != SEND_SIG_NOINFO && (is_si_special(info) || SI_FROMKERNEL(info)))
return 0;

if (!sig)
Expand Down

0 comments on commit 906b80b

Please sign in to comment.