diff options
author | Andy Lutomirski <luto@amacapital.net> | 2013-08-22 11:39:15 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 17:18:05 -0700 |
commit | 979ad974d2d7d1e98e21b582a11acdf0713914e6 (patch) | |
tree | aa0d67ecd11d881a2d412fae5c3870c0de5071f2 /net | |
parent | ac78ae630c039e548e2b8d41b6036f240386d770 (diff) | |
download | linux-3.10-979ad974d2d7d1e98e21b582a11acdf0713914e6.tar.gz linux-3.10-979ad974d2d7d1e98e21b582a11acdf0713914e6.tar.bz2 linux-3.10-979ad974d2d7d1e98e21b582a11acdf0713914e6.zip |
net: Check the correct namespace when spoofing pid over SCM_RIGHTS
commit d661684cf6820331feae71146c35da83d794467e upstream.
This is a security bug.
The follow-up will fix nsproxy to discourage this type of issue from
happening again.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/scm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/scm.c b/net/core/scm.c index 03795d0147f..b4da80b1cc0 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -54,7 +54,7 @@ static __inline__ int scm_check_creds(struct ucred *creds) return -EINVAL; if ((creds->pid == task_tgid_vnr(current) || - ns_capable(current->nsproxy->pid_ns->user_ns, CAP_SYS_ADMIN)) && + ns_capable(task_active_pid_ns(current)->user_ns, CAP_SYS_ADMIN)) && ((uid_eq(uid, cred->uid) || uid_eq(uid, cred->euid) || uid_eq(uid, cred->suid)) || nsown_capable(CAP_SETUID)) && ((gid_eq(gid, cred->gid) || gid_eq(gid, cred->egid) || |