aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 4530fc654455..167b535fe1a9 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -567,6 +567,7 @@ static int check_kill_permission(int sig, struct siginfo *info,
567 struct task_struct *t) 567 struct task_struct *t)
568{ 568{
569 struct pid *sid; 569 struct pid *sid;
570 uid_t uid, euid;
570 int error; 571 int error;
571 572
572 if (!valid_signal(sig)) 573 if (!valid_signal(sig))
@@ -579,8 +580,10 @@ static int check_kill_permission(int sig, struct siginfo *info,
579 if (error) 580 if (error)
580 return error; 581 return error;
581 582
582 if ((current->euid ^ t->suid) && (current->euid ^ t->uid) && 583 uid = current_uid();
583 (current->uid ^ t->suid) && (current->uid ^ t->uid) && 584 euid = current_euid();
585 if ((euid ^ t->suid) && (euid ^ t->uid) &&
586 (uid ^ t->suid) && (uid ^ t->uid) &&
584 !capable(CAP_KILL)) { 587 !capable(CAP_KILL)) {
585 switch (sig) { 588 switch (sig) {
586 case SIGCONT: 589 case SIGCONT:
@@ -844,7 +847,7 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
844 q->info.si_errno = 0; 847 q->info.si_errno = 0;
845 q->info.si_code = SI_USER; 848 q->info.si_code = SI_USER;
846 q->info.si_pid = task_pid_vnr(current); 849 q->info.si_pid = task_pid_vnr(current);
847 q->info.si_uid = current->uid; 850 q->info.si_uid = current_uid();
848 break; 851 break;
849 case (unsigned long) SEND_SIG_PRIV: 852 case (unsigned long) SEND_SIG_PRIV:
850 q->info.si_signo = sig; 853 q->info.si_signo = sig;
@@ -1598,7 +1601,7 @@ void ptrace_notify(int exit_code)
1598 info.si_signo = SIGTRAP; 1601 info.si_signo = SIGTRAP;
1599 info.si_code = exit_code; 1602 info.si_code = exit_code;
1600 info.si_pid = task_pid_vnr(current); 1603 info.si_pid = task_pid_vnr(current);
1601 info.si_uid = current->uid; 1604 info.si_uid = current_uid();
1602 1605
1603 /* Let the debugger run. */ 1606 /* Let the debugger run. */
1604 spin_lock_irq(&current->sighand->siglock); 1607 spin_lock_irq(&current->sighand->siglock);
@@ -2211,7 +2214,7 @@ sys_kill(pid_t pid, int sig)
2211 info.si_errno = 0; 2214 info.si_errno = 0;
2212 info.si_code = SI_USER; 2215 info.si_code = SI_USER;
2213 info.si_pid = task_tgid_vnr(current); 2216 info.si_pid = task_tgid_vnr(current);
2214 info.si_uid = current->uid; 2217 info.si_uid = current_uid();
2215 2218
2216 return kill_something_info(sig, &info, pid); 2219 return kill_something_info(sig, &info, pid);
2217} 2220}
@@ -2228,7 +2231,7 @@ static int do_tkill(pid_t tgid, pid_t pid, int sig)
2228 info.si_errno = 0; 2231 info.si_errno = 0;
2229 info.si_code = SI_TKILL; 2232 info.si_code = SI_TKILL;
2230 info.si_pid = task_tgid_vnr(current); 2233 info.si_pid = task_tgid_vnr(current);
2231 info.si_uid = current->uid; 2234 info.si_uid = current_uid();
2232 2235
2233 rcu_read_lock(); 2236 rcu_read_lock();
2234 p = find_task_by_vpid(pid); 2237 p = find_task_by_vpid(pid);