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: <1125e8a68a709e18b594f74fc9b25b9992b1582f.camel@perches.com>
Date:   Wed, 07 Sep 2022 08:18:31 -0700
From:   Joe Perches <joe@...ches.com>
To:     Philippe Schenker <dev@...henker.ch>,
        Andy Whitcroft <apw@...onical.com>,
        linux-kernel@...r.kernel.org
Cc:     Stephen Rothwell <sfr@...b.auug.org.au>,
        Dwaipayan Ray <dwaipayanray1@...il.com>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Philippe Schenker <philippe.schenker@...adex.com>
Subject: Re: [PATCH] checkpatch: add check for fixes: tag

On Wed, 2022-09-07 at 14:35 +0200, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@...adex.com>
> 
> The page about submitting patches in
> Documentation/process/submitting-patches.rst is very specific on how that
> tag should be formatted: 'Fixes: <12+ chars of sha1> (\"<title line>\")'
> 
> Add a rule that warns if this format does not match. This commit is
> introduced as in the past commits have been sent multiple times with
> having the word commit also in the Fixes: tag which had to be corrected
> by the maintainers. [1]

I preferred your first patch that added the commit description match
as that's a fairly common defect.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3438,6 +3438,13 @@ sub process {
>  			}
>  		}
>  
> +# Check fixes tag format
> +		if ($in_commit_log && ($line =~ /^\s*Fixes:/i) &&
> +			!($line =~ /^\s*Fixes:\s[0-9a-f]{12,40}\s\(\".*\"\)/)) {

All fixes lines should start in the first column.

This allows spaces at the start of the line and the only white space
allowed after Fixes: and after the SHA1 should be a space not a tab.

I think the test better if it checks for a SHA1 after fixes.

And IMO

	!(foo =~ /bar.../)

is better written as

	foo !~ /bar.../

so

		if ($in_commit_log &&
		    $line =~ /^\s*Fixes:?\s*[0-9a-f]{5,}\b/i &&
		    $line !~ /^Fixes: [0-9a-f]{12,40} \(\".*\"\)/)) {

Though it's arguable that the SHA1 should _only_ be length 12
and not longer.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ