diff options
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index d6303277a640..aef629c65c87 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -767,11 +767,10 @@ static int kill_ok_by_cred(struct task_struct *t) | |||
767 | const struct cred *cred = current_cred(); | 767 | const struct cred *cred = current_cred(); |
768 | const struct cred *tcred = __task_cred(t); | 768 | const struct cred *tcred = __task_cred(t); |
769 | 769 | ||
770 | if (cred->user_ns == tcred->user_ns && | 770 | if (uid_eq(cred->euid, tcred->suid) || |
771 | (cred->euid == tcred->suid || | 771 | uid_eq(cred->euid, tcred->uid) || |
772 | cred->euid == tcred->uid || | 772 | uid_eq(cred->uid, tcred->suid) || |
773 | cred->uid == tcred->suid || | 773 | uid_eq(cred->uid, tcred->uid)) |
774 | cred->uid == tcred->uid)) | ||
775 | return 1; | 774 | return 1; |
776 | 775 | ||
777 | if (ns_capable(tcred->user_ns, CAP_KILL)) | 776 | if (ns_capable(tcred->user_ns, CAP_KILL)) |
@@ -1389,10 +1388,8 @@ static int kill_as_cred_perm(const struct cred *cred, | |||
1389 | struct task_struct *target) | 1388 | struct task_struct *target) |
1390 | { | 1389 | { |
1391 | const struct cred *pcred = __task_cred(target); | 1390 | const struct cred *pcred = __task_cred(target); |
1392 | if (cred->user_ns != pcred->user_ns) | 1391 | if (!uid_eq(cred->euid, pcred->suid) && !uid_eq(cred->euid, pcred->uid) && |
1393 | return 0; | 1392 | !uid_eq(cred->uid, pcred->suid) && !uid_eq(cred->uid, pcred->uid)) |
1394 | if (cred->euid != pcred->suid && cred->euid != pcred->uid && | ||
1395 | cred->uid != pcred->suid && cred->uid != pcred->uid) | ||
1396 | return 0; | 1393 | return 0; |
1397 | return 1; | 1394 | return 1; |
1398 | } | 1395 | } |