net: fix incorrect credentials passing

CVE-2013-1979

[ Upstream commit 83f1b4ba917db5dc5a061a44b3403ddb6e783494 ]

Commit 257b5358b3 ("scm: Capture the full credentials of the scm
sender") changed the credentials passing code to pass in the effective
uid/gid instead of the real uid/gid.

Obviously this doesn't matter most of the time (since normally they are
the same), but it results in differences for suid binaries when the wrong
uid/gid ends up being used.

This just undoes that (presumably unintentional) part of the commit.

Reported-by: Andy Lutomirski <luto@amacapital.net>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Serge E. Hallyn <serge@hallyn.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
This commit is contained in:
Linus Torvalds
2013-04-19 15:32:32 +00:00
committed by Tim Gardner
parent 68abafa89d
commit d665c750d6
3 changed files with 13 additions and 6 deletions

View File

@@ -316,7 +316,8 @@ struct ucred {
/* IPX options */
#define IPX_TYPE 1
extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred,
bool use_effective);
extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,