]> git.baikalelectronics.ru Git - kernel.git/commit
exec: Test the ptracer's saved cred to see if the tracee can gain caps
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 23 Jan 2017 04:17:26 +0000 (17:17 +1300)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 23 Jan 2017 23:03:08 +0000 (12:03 +1300)
commitba4d3e1d2ede859c16ea6a42304e865d56fcd92a
tree9f34d81fd0c96881c8d66413184b5f736e6f626c
parent078dad0803b426536ca0907d24da385a2de90a77
exec: Test the ptracer's saved cred to see if the tracee can gain caps

Now that we have user namespaces and non-global capabilities verify
the tracer has capabilities in the relevant user namespace instead
of in the current_user_ns().

As the test for setting LSM_UNSAFE_PTRACE_CAP is currently
ptracer_capable(p, current_user_ns()) and the new task credentials are
in current_user_ns() this change does not have any user visible change
and simply moves the test to where it is used, making the code easier
to read.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
security/commoncap.c