Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83f1b4b

Browse files
torvaldsdavem330
authored andcommitted
net: fix incorrect credentials passing
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 <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Serge E. Hallyn <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]> Acked-by: "Eric W. Biederman" <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c846ad9 commit 83f1b4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)