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: <173cc189627e0d6618b535fcd1ce6a4c90ce2ad0.camel@perches.com>
Date:   Wed, 04 Jul 2018 11:30:53 -0700
From:   Joe Perches <joe@...ches.com>
To:     Prakruthi Deepak Heragu <pheragu@...eaurora.org>,
        apw@...onical.com, Julia Lawall <julia.lawall@...6.fr>,
        Dan Carpenter <error27@...il.com>
Cc:     linux-kernel@...r.kernel.org, ckadabi@...eaurora.org,
        tsoni@...eaurora.org, bryanh@...eaurora.org,
        Israel Schlesinger <israels@...eaurora.org>,
        Stepan Moskovchenko <stepanm@...eaurora.org>
Subject: Re: [PATCH] checkpatch: Add warnings for use of mdelay()

On Wed, 2018-07-04 at 11:18 -0700, Prakruthi Deepak Heragu wrote:
> mdelay() is not a preferred API to be used to insert delay in the kernel
> code unless the context is atomic. Instead, msleep() API can be used.
> This patch introduces this warning.

[]

> Signed-off-by: Israel Schlesinger <israels@...eaurora.org>
> Signed-off-by: Stepan Moskovchenko <stepanm@...eaurora.org>
> Signed-off-by: Prakruthi Deepak Heragu <pheragu@...eaurora.org>

Really? 3 sign-offs for one trivial patch while
getting simple whitespace issues wrong?

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -5572,6 +5572,12 @@ sub process {
>  			     "Comparing get_jiffies_64() is almost always wrong; prefer time_after64, time_before64 and friends\n" . $herecurr);
>  		}
>  
> +# check the patch for use of mdelay
> +		if ($line =~ /\bmdelay\s*\(/) {
> +			WARN("MDELAY",
> +			     "use of mdelay() found: msleep() is the preferred API.\n" . $herecurr );

No space after $herecurr

> +		}
> +

NACK - I think this is unreasonable.

checkpatch is stupid and can only remain that way.

It cannot check for any particular use in atomic
that is appropriate and should not warn with a
false positive when the use is appropriate.

$ git grep -w mdelay | wc -l
2700

How many of those are correct?

If you want a check like this to be useful, write
something for coccinelle or smatch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ