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: <20070725165420.GD3572@stusta.de>
Date:	Wed, 25 Jul 2007 18:54:20 +0200
From:	Adrian Bunk <bunk@...sta.de>
To:	SL Baur <steve@...acs.org>
Cc:	jschopp <jschopp@...tin.ibm.com>,
	Andy Whitcroft <apw@...dowen.org>,
	Jan Engelhardt <jengelh@...putergmbh.de>,
	Paul Mundt <lethal@...ux-sh.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Kok, Auke" <auke-jan.h.kok@...el.com>,
	Randy Dunlap <rdunlap@...otime.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] update checkpatch.pl to version 0.08

On Wed, Jul 25, 2007 at 08:39:36AM -0700, SL Baur wrote:
> On 7/24/07, Adrian Bunk <bunk@...sta.de> wrote:
>
>> There are more important things than exploiting the corner cases of
>> codingstyle, e.g. could you teach checkpatch.pl to give exactly two
>> errors for the following code?
>>
>>
>>         while (a);
>>                 for (b = 0; b < 50; b++);
>>                         for (c = 0; c < sizeof(struct module); c++)
>>                                 d = e;
>
> There are three errors there.  The while (a) busy wait needs a cpu_relax()

OK, granted. But this is dummy code, and this is not what I'd expect 
checkpatch.pl to check for.

> or something, the first for is at the wrong level of indentation and the
> second for is at the wrong level of indentation relative to the first one.

If someone writes the code this way, the problem is usually not the 
indentation that is most likely correct, but the fact that the code does 
something completely different from what the author thought it would do.

We already had such bugs in the kernel, they are unlikely to be spotted 
at code review, but for a script that looks at the source code they 
should be easy to spot.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ