lkml.org 
[lkml]   [2013]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [ 105/124] af_unix: dont send SCM_CREDENTIAL when dest socket is NULL
From
Date
On Wed, 2013-04-03 at 10:58 -0700, Andy Lutomirski wrote:

>
> This sounds suspiciously like an SCM_CREDENTIALS bug triggered by a
> race. There's a fix (that needs both a new version from me and a review
> by someone) here:
>
> http://www.spinics.net/lists/netdev/msg229948.html

Hmm... this is not a stable candidate, IMHO.

This has to be fixed (if needed) in a more easy way.

What about this one liner ?

CC Eric W. Biederman as he wrote commit
dbe9a4173ea53b72b2c3
(scm: Don't use struct ucred in NETLINK_CB and struct scm_cookie.)

diff --git a/include/net/scm.h b/include/net/scm.h
index 975cca0..42359d8 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -120,7 +120,7 @@ static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg,
return;
}

- if (test_bit(SOCK_PASSCRED, &sock->flags)) {
+ if (test_bit(SOCK_PASSCRED, &sock->flags) && scm->creds.pid) {
struct user_namespace *current_ns = current_user_ns();
struct ucred ucreds = {
.pid = scm->creds.pid,



\
 
 \ /
  Last update: 2013-04-03 21:22    [W:0.134 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site