[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B7395@saturn3.aculab.com>
Date: Fri, 18 Oct 2013 09:26:11 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Daniel Borkmann" <dborkman@...hat.com>, <davem@...emloft.net>
Cc: <netdev@...r.kernel.org>, "Eric Dumazet" <edumazet@...gle.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: RE: [PATCH net] net: unix: inherit SOCK_PASS{CRED,SEC} flags from socket to fix race
> Subject: [PATCH net] net: unix: inherit SOCK_PASS{CRED,SEC} flags from socket to fix race
>
> In the case of credentials passing in unix stream sockets (dgram
> sockets seem not affected), we get a rather sparse race after
> commit 16e5726 ("af_unix: dont send SCM_CREDENTIALS by default").
...
> +static void unix_sock_inherit_flags(const struct socket *old,
> + struct socket *new)
> +{
> + if (test_bit(SOCK_PASSCRED, &old->flags))
> + set_bit(SOCK_PASSCRED, &new->flags);
> + if (test_bit(SOCK_PASSSEC, &old->flags))
> + set_bit(SOCK_PASSSEC, &new->flags);
> +}
> +
Isn't that just:
new->flags |= old->flags & (PASSCRED | SOCK_PASSSEC);
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists