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:	Mon, 28 Nov 2011 16:53:36 -0000
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"Eric Dumazet" <eric.dumazet@...il.com>,
	"Joe Perches" <joe@...ches.com>
Cc:	"David Miller" <davem@...emloft.net>,
	"netdev" <netdev@...r.kernel.org>,
	"Michal Miroslaw" <mirq-linux@...e.qmqm.pl>
Subject: RE: [PATCH net-next] tcp: tcp_sendmsg() wrong access to sk_route_caps

 
> > > -	sg = sk->sk_route_caps & NETIF_F_SG;
> > > +	sg = !!(sk->sk_route_caps & NETIF_F_SG);
> > 
> > As sg is now bool, using !! is unnecessary.
> > 
> > A commit was done recently to remove one.
> > 3ad9b358e03fd9dbf6705721490c811b666b0fe2
> > 
> 
> Hmm... I find it dangerous and error prone. Obviously not at 
> the time we
> commit such changes, but later, because a future reader might 
> be fooled.
> 
> Using !!(expr) is pretty clear about the potential problem, and
> generates no extra code if a bool is used for the target.

Or leave 'sg' as 'unsigned int' and add:
    COMPILE_ASSERT(NETIF_F_SG & ~0);
(or however linux spells the appropriate define)

	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