scm: Capture the full credentials of the scm sender
authorTim Chen <tim.c.chen@linux.intel.com>
Tue, 9 Aug 2011 06:48:32 +0000 (06:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Aug 2011 12:52:57 +0000 (05:52 -0700)
This patch corrects an erroneous update of credential's gid with uid
introduced in commit 257b5358b32f17 since 2.6.36.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/scm.c

index 4c1ef02..811b53f 100644 (file)
@@ -192,7 +192,7 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p)
                                        goto error;
 
                                cred->uid = cred->euid = p->creds.uid;
-                               cred->gid = cred->egid = p->creds.uid;
+                               cred->gid = cred->egid = p->creds.gid;
                                put_cred(p->cred);
                                p->cred = cred;
                        }