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]
Message-ID: <20150111193404.GN1513@betelgeuse.hsd1.ma.comcast.net>
Date:	Sun, 11 Jan 2015 14:34:04 -0500
From:	Christoph Jaeger <cj@...ux.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Alan <alan@...ux.intel.com>, davem@...emloft.net,
	willemb@...gle.com, edumazet@...gle.com, dborkman@...hat.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] packet: bail out of packet_snd() if L2 header
 creation fails

On Sun, Jan 11, 2015 at 10:52:25AM -0800, Joe Perches wrote:
> On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote:
> > Due to a misplaced parenthesis, the expression
> > 
> >   (unlikely(offset) < 0),
> > 
> > which expands to
> > 
> >   (__builtin_expect(!!(offset), 0) < 0),
> 
> Here's another one:
> 
> drivers/platform/goldfish/goldfish_pipe.c:285:	if (unlikely(bufflen) == 0)

Well, the conditional statement works as intended. Of course, the branch
prediction doesn't.

Coccinelle should be able to check for this kind of likely()/unlikely() usage,
shouldn't it?

~Christoph
--
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