From ba57c1ab7eaf7c15f607321fe659be4f1cf647f2 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 21 Aug 2012 06:21:17 +0000 Subject: [PATCH] --- yaml --- r: 322052 b: refs/heads/master c: e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/net/scm.h | 4 +++- trunk/net/netlink/af_netlink.c | 2 +- trunk/net/unix/af_unix.c | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index d48dd5cb7ba9..e859402801b2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a9915a1b52df52ad87f3b33422da95cf25372f09 +refs/heads/master: e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea diff --git a/trunk/include/net/scm.h b/trunk/include/net/scm.h index 079d7887dac1..7dc0854f0b38 100644 --- a/trunk/include/net/scm.h +++ b/trunk/include/net/scm.h @@ -70,9 +70,11 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) } static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, - struct scm_cookie *scm) + struct scm_cookie *scm, bool forcecreds) { memset(scm, 0, sizeof(*scm)); + if (forcecreds) + scm_set_cred(scm, task_tgid(current), current_cred()); unix_get_peersec_dgram(sock, scm); if (msg->msg_controllen <= 0) return 0; diff --git a/trunk/net/netlink/af_netlink.c b/trunk/net/netlink/af_netlink.c index 5463969da45b..1445d73533ed 100644 --- a/trunk/net/netlink/af_netlink.c +++ b/trunk/net/netlink/af_netlink.c @@ -1362,7 +1362,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock, if (NULL == siocb->scm) siocb->scm = &scm; - err = scm_send(sock, msg, siocb->scm); + err = scm_send(sock, msg, siocb->scm, true); if (err < 0) return err; diff --git a/trunk/net/unix/af_unix.c b/trunk/net/unix/af_unix.c index e4768c180da2..c5ee4ff61364 100644 --- a/trunk/net/unix/af_unix.c +++ b/trunk/net/unix/af_unix.c @@ -1450,7 +1450,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, if (NULL == siocb->scm) siocb->scm = &tmp_scm; wait_for_unix_gc(); - err = scm_send(sock, msg, siocb->scm); + err = scm_send(sock, msg, siocb->scm, false); if (err < 0) return err; @@ -1619,7 +1619,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, if (NULL == siocb->scm) siocb->scm = &tmp_scm; wait_for_unix_gc(); - err = scm_send(sock, msg, siocb->scm); + err = scm_send(sock, msg, siocb->scm, false); if (err < 0) return err;