mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]>
This commit is contained in:
parent
7e6bd8fadd
commit
c4a4d60379
12 changed files with 24 additions and 24 deletions
|
|
@ -767,14 +767,14 @@ static int kill_ok_by_cred(struct task_struct *t)
|
|||
const struct cred *cred = current_cred();
|
||||
const struct cred *tcred = __task_cred(t);
|
||||
|
||||
if (cred->user->user_ns == tcred->user->user_ns &&
|
||||
if (cred->user_ns == tcred->user_ns &&
|
||||
(cred->euid == tcred->suid ||
|
||||
cred->euid == tcred->uid ||
|
||||
cred->uid == tcred->suid ||
|
||||
cred->uid == tcred->uid))
|
||||
return 1;
|
||||
|
||||
if (ns_capable(tcred->user->user_ns, CAP_KILL))
|
||||
if (ns_capable(tcred->user_ns, CAP_KILL))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue