aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2011-11-17 02:15:31 -0500
committerEric W. Biederman <ebiederm@xmission.com>2012-04-07 19:55:51 -0400
commitc4a4d603796c727b9555867571f89483be9c565e (patch)
treeae3b47a7b8b35c866df53cb4b4a051d49a28904a /kernel/signal.c
parent7e6bd8fadd1216f50468f965d0308f45e5109ced (diff)
userns: Use cred->user_ns instead of cred->user->user_ns
Optimize performance and prepare for the removal of the user_ns reference from user_struct. Remove the slow long walk through cred->user->user_ns and instead go straight to cred->user_ns. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 17afcaf582d0..e2c5d84f2dac 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -767,14 +767,14 @@ 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->user_ns == tcred->user->user_ns && 770 if (cred->user_ns == tcred->user_ns &&
771 (cred->euid == tcred->suid || 771 (cred->euid == tcred->suid ||
772 cred->euid == tcred->uid || 772 cred->euid == tcred->uid ||
773 cred->uid == tcred->suid || 773 cred->uid == tcred->suid ||
774 cred->uid == tcred->uid)) 774 cred->uid == tcred->uid))
775 return 1; 775 return 1;
776 776
777 if (ns_capable(tcred->user->user_ns, CAP_KILL)) 777 if (ns_capable(tcred->user_ns, CAP_KILL))
778 return 1; 778 return 1;
779 779
780 return 0; 780 return 0;