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: <20221123011202.939319-2-elliott@hpe.com>
Date:   Tue, 22 Nov 2022 19:11:58 -0600
From:   Robert Elliott <elliott@....com>
To:     apw@...onical.com, joe@...ches.com, dwaipayanray1@...il.com,
        lukas.bulwahn@...il.com
Cc:     linux-kernel@...r.kernel.org, Robert Elliott <elliott@....com>
Subject: [PATCH v2 1/5] checkpatch: improve Kconfig help text patch parsing

While parsing Kconfig help text, allow the strings that affect
parsing (e.g., help, bool, tristate, and prompt) to be in existing
text, not just added text (i.e., allow both + and a space character
at the beginning of the line).

This improves parsing of a patch like:

+config CRYPTO_SHA512_S390
+       tristate "SHA384 and SHA512 (s390)"
+       depends on S390
        select CRYPTO_HASH
        help
-         SHA512 secure hash standard (DFIPS 180-2).
+         SHA-384 and SHA-512 secure hash algorithms (FIPS 180)

-         This version of SHA implements a 512 bit hash with 256 bits of
-         security against collision attacks.
+         Architecture: s390

-         This code also includes SHA-384, a 384 bit hash with 192 bits
-         of security against collision attacks.
+         It is available as of z10.

Signed-off-by: Robert Elliott <elliott@....com>
---
 scripts/checkpatch.pl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c8a616a9d034..1d9e563e768a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3490,11 +3490,11 @@ sub process {
 				next if ($f =~ /^-/);
 				last if ($f !~ /^[\+ ]/);	# !patch context
 
-				if ($f =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) {
+				if ($f =~ /^[\+ ]\s*(?:bool|tristate|prompt)\s*["']/) {
 					$needs_help = 1;
 					next;
 				}
-				if ($f =~ /^\+\s*help\s*$/) {
+				if ($f =~ /^[\+ ]\s*help\s*$/) {
 					$has_help = 1;
 					next;
 				}
@@ -3519,7 +3519,8 @@ sub process {
 			    $help_length < $min_conf_desc_length) {
 				my $stat_real = get_stat_real($linenr, $ln - 1);
 				WARN("CONFIG_DESCRIPTION",
-				     "please write a help paragraph that fully describes the config symbol\n" . "$here\n$stat_real\n");
+				     "please write $min_conf_desc_length lines of help text that fully describes the config symbol (detected $help_length lines)\n" .
+				     "$here\n$stat_real\n");
 			}
 		}
 
-- 
2.38.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ