lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ