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>] [day] [month] [year] [list]
Message-Id: <20230403231821.4737-1-scott.branden@broadcom.com>
Date:   Mon,  3 Apr 2023 16:18:21 -0700
From:   Scott Branden <scott.branden@...adcom.com>
To:     BCM Kernel Feedback <bcm-kernel-feedback-list@...adcom.com>,
        Andy Whitcroft <apw@...onical.com>,
        Joe Perches <joe@...ches.com>
Cc:     Dwaipayan Ray <dwaipayanray1@...il.com>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>,
        linux-kernel@...r.kernel.org,
        Scott Branden <scott.branden@...adcom.com>
Subject: [PATCH] checkpatch: improve signature check on empty description

Existing check assumed there could be a single Signed-off-by line which
should be ignored when checking for an empty commit message.
Other lines with identifiers "Reported-by:", "Acked-by:", or anything
invented by the person who constructed the commit were counted as a
body of the commit message.

Improve the check for an empty body of the commit message by not counting
any lines that begin with a $signature or similar formatted line of a
keyword followed by a colon.

Signed-off-by: Scott Branden <scott.branden@...adcom.com>
---
 scripts/checkpatch.pl | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd44d12965c9..5922a6df7f5d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2901,15 +2901,14 @@ sub process {
 		$cnt_lines++ if ($realcnt != 0);
 
 # Verify the existence of a commit log if appropriate
-# 2 is used because a $signature is counted in $commit_log_lines
 		if ($in_commit_log) {
-			if ($line !~ /^\s*$/) {
-				$commit_log_lines++;	#could be a $signature
+			if ($line !~ /^\s*($|[a-zA-Z0-9_-]+:)/) {
+				$commit_log_lines++;
 			}
-		} elsif ($has_commit_log && $commit_log_lines < 2) {
+		} elsif ($has_commit_log && $commit_log_lines < 1) {
 			WARN("COMMIT_MESSAGE",
 			     "Missing commit description - Add an appropriate one\n");
-			$commit_log_lines = 2;	#warn only once
+			$commit_log_lines = 1;	#warn only once
 		}
 
 # Check if the commit log has what seems like a diff which can confuse patch
-- 
2.40.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ