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]
Date:   Mon, 09 Jan 2017 14:16:18 -0800
From:   Joe Perches <joe@...ches.com>
To:     Alexey Dobriyan <adobriyan@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org, apw@...onical.com
Subject: Re: [PATCH] checkpatch.pl: warn against using %Z

On Tue, 2017-01-10 at 02:59 +0300, Alexey Dobriyan wrote:
> %Z is going to be removed in favour of %z.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
> ---
> 
>  scripts/checkpatch.pl |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5189,6 +5189,12 @@ sub process {
>  				     "\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
>  				last;
>  			}
> +			# check for %Z
> +			if ($string =~ /(?<!%)%[\*\d\.\$]*Z[diouxX]/) {
> +				WARN("PRINTF_Z",
> +				     "%Z is non-standard C, use %z\n" . $herecurr);
> +				last;
> +			}
>  			if ($string =~ /0x%[\*\d\.\$\Llzth]*[udi]/) {
>  				ERROR("PRINTF_0xDECIMAL",
>  				      "Prefixing 0x with decimal output is defective\n" . $herecurr);

Right concept, slightly incorrect implementation.

diouxX isn't necessary, ?<!% isn't necessary either as
there's a s/%%/__/g above it, last; probably isn't a
good idea as a single string could have both %Lu and
%Zu and unrelated, thanks for reminding me, I knew but
forgot to fix, the PRINTF_0xDECIMAL is defective as
there's a requirement that the match string only use
upper case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ