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: <2bac2cd3-ccdc-413f-aae7-110b5c36122a@moroto.mountain>
Date: Wed, 6 Mar 2024 18:08:59 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Lukas Bulwahn <lukas.bulwahn@...il.com>,
	Andy Whitcroft <apw@...onical.com>
Cc: Joe Perches <joe@...ches.com>,
	kernel-janitors <kernel-janitors@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: checkpatch.pl getting stuck on a macro in mm/kmsan/kmsan_test.c

On Wed, Mar 06, 2024 at 10:33:55AM +0100, Lukas Bulwahn wrote:
> Dear Joe,
> 
> while running checkpatch.pl -f on all files in the kernel repository
> (v6.8-rc1) for some experiment, I noticed that checkpatch.pl got stuck
> on mm/kmsan/kmsan_test.c, i.e., ./scripts/checkpatch.pl -f
> mm/kmsan/kmsan_test.c never terminates.
> 
> I could already boil it down to checkpatch getting stuck on the macro
> #define DEFINE_TEST_MEMSETXX(size), see lines 541 to 554 in
> mm/kmsan/kmsan_test.c on v6.8-rc1.
> 
> I do not know if it is worth fixing, but certainly I was surprised
> that reasonable code can put checkpatch into some stuck state.

I think the bug is ancient...  Here is a stupid solution.  But afterward
it still prints a ton of Perl warnings:

substr outside of string at ./scripts/checkpatch.pl line 5158.
Use of uninitialized value $op_type in string ne at ./scripts/checkpatch.pl line 5164.
substr outside of string at ./scripts/checkpatch.pl line 5158.
Use of uninitialized value $op_type in string ne at ./scripts/checkpatch.pl line 5164.

regards,
dan carpenter

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9c4c4a61bc83..bd7a286bc1ce 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2260,10 +2260,14 @@ sub annotate_values {
 		} elsif ($cur =~ /(^.)/o) {
 			print "C($1)\n" if ($dbg_values > 1);
 		}
+		my $old = $cur;
 		if (defined $1) {
 			$cur = substr($cur, length($1));
 			$res .= $type x length($1);
 		}
+		if ($old eq $cur) {
+			last;
+		}
 	}
 
 	return ($res, $var);



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ