summaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorKirill Tkhai2017-05-02 19:11:52 +0200
committerEric W. Biederman2017-07-20 14:46:06 +0200
commit64db4c7f4c1dde23d47b60f887000e28f82b268f (patch)
treee7f344fb2015e7c138fc1d05804da2969c205be9 /kernel/sys.c
parentuserns,pidns: Verify the userns for new pid namespaces (diff)
downloadkernel-qcow2-linux-64db4c7f4c1dde23d47b60f887000e28f82b268f.tar.gz
kernel-qcow2-linux-64db4c7f4c1dde23d47b60f887000e28f82b268f.tar.xz
kernel-qcow2-linux-64db4c7f4c1dde23d47b60f887000e28f82b268f.zip
security: Use user_namespace::level to avoid redundant iterations in cap_capable()
When ns->level is not larger then cred->user_ns->level, then ns can't be cred->user_ns's descendant, and there is no a sense to search in parents. So, break the cycle earlier and skip needless iterations. v2: Change comment on suggested by Andy Lutomirski. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel/sys.c')
0 files changed, 0 insertions, 0 deletions