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: <decdb749f0192bd886faa7e8470795fb2644e4f8.camel@perches.com>
Date:   Fri, 16 Apr 2021 09:11:49 -0700
From:   Joe Perches <joe@...ches.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        apw@...onical.com, dwaipayanray1@...il.com, lukas.bulwahn@...il.com
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] checkpatch: Improve ALLOC_ARRAY_ARGS test

On Fri, 2021-04-16 at 17:58 +0200, Christophe JAILLET wrote:
> The devm_ variant of 'kcalloc()' and 'kmalloc_array()' are not tested
> Add the corresponding check.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -7006,9 +7006,9 @@ sub process {
>  		}
>  
> 
>  # check for alloc argument mismatch
> -		if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) {
> +		if ($line =~ /\b(devm_|)(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) {

Perhaps nicer using

		if ($line =~ /\b((?:devm_)?(?:kcalloc|kmalloc_array))\s*\*\s*sizeof\b/) {

>  			WARN("ALLOC_ARRAY_ARGS",
> -			     "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
> +			     "$1$2 uses number as first arg, sizeof is generally wrong\n" . $herecurr);

So there's only one capture group and this line doesn't need to be changed.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ