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] [day] [month] [year] [list]
Message-ID: <20140214184803.GA16115@redhat.com>
Date:	Fri, 14 Feb 2014 13:48:03 -0500
From:	Dave Jones <davej@...hat.com>
To:	David Miller <davem@...emloft.net>
Cc:	julia.lawall@...6.fr, joe@...ches.com, stephen@...workplumber.org,
	netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: remove unnecessary return's

On Fri, Feb 14, 2014 at 01:41:37PM -0500, David Miller wrote:
 > From: Julia Lawall <julia.lawall@...6.fr>
 > Date: Fri, 14 Feb 2014 10:58:00 +0100 (CET)
 > 
 > > On Thu, 13 Feb 2014, David Miller wrote:
 > > 
 > >> I think it is valuable, it's so much easier to audit the return paths
 > >> via a process of elimination with that kind of layout.  A return in
 > >> the middle of that looks out of place at best.
 > > 
 > > Actually, I had a student who made a tool that went the other way around,
 > > and introduced goto labels for sharable error handling code.  We didn't
 > > get around to using it to send patches, though.  In that tool, we didn't
 > > create labels just for returns, with the thought that in that case there
 > > was no point to introduce a goto if there was nothing to share.
 > 
 > That's one perspective.
 > 
 > But think of it this way, if there is a seqeuence of labels already and
 > you're scanning for a large body of code for control transfers during
 > an audit, what are your eyes more likely to miss?
 > 
 > A sequence goto statements targetting well named and distinct labels
 > or that "return" hidding there somewhere in the middle?

No argument about 'in the middle', but the suggestion upthread was for
the very first case before there are any allocations etc that need unwinding.

	Dave

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