Skip to content

Commit 98c287e

Browse files
torvaldsgregkh
authored andcommitted
net: fix incorrect credentials passing
[ Upstream commit 83f1b4b ] Commit 257b535 ("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>
1 parent 24fce11 commit 98c287e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/net/scm.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm,
5656
scm->pid = get_pid(pid);
5757
scm->cred = cred ? get_cred(cred) : NULL;
5858
scm->creds.pid = pid_vnr(pid);
59-
scm->creds.uid = cred ? cred->euid : INVALID_UID;
60-
scm->creds.gid = cred ? cred->egid : INVALID_GID;
59+
scm->creds.uid = cred ? cred->uid : INVALID_UID;
60+
scm->creds.gid = cred ? cred->gid : INVALID_GID;
6161
}
6262

6363
static __inline__ void scm_destroy_cred(struct scm_cookie *scm)

0 commit comments

Comments
 (0)