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: <20251128102623.645512-1-kory.maincent@bootlin.com>
Date: Fri, 28 Nov 2025 11:26:22 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: linux-kernel@...r.kernel.org
Cc: Kory Maincent <kory.maincent@...tlin.com>,
	Jérémie Dautheribes <jeremie.dautheribes@...tlin.com>,
	Louis Chauvet <louis.chauvet@...tlin.com>,
	thomas.petazzoni@...tlin.com,
	Andy Whitcroft <apw@...onical.com>,
	Joe Perches <joe@...ches.com>,
	Dwaipayan Ray <dwaipayanray1@...il.com>,
	Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: [PATCH] checkpatch: Add support for long UTF-8 name

In case we have a long utf-8 name the second line will contain UTF-8
code.

Here is an example:
  From: =?UTF-8?q?K=C3=B6ry=20Maincent=20=28bla=20blou=20prout=20test=20?=
   =?UTF-8?q?=29?= <kory.maincent@...tlin.com>
  Date: Fri, 28 Nov 2025 10:57:00 +0100
  Subject: [PATCH] checkpatch: Add support for long UTF-8 name

On this rare case checkpatch is returning an error due to UTF-8 code in
the name as it only decodes the From once the line is fully concatenated.
  WARNING: From:/Signed-off-by: email name mismatch: 'From: "Köry Maincent
  (bla blou prout test test=?UTF-8?q?=29?=" <kory.maincent@...tlin.com>'
  != 'Signed-off-by: Köry Maincent (bla blou prout test test)
  <kory.maincent@...tlin.com>'

Decode each line instead to be sure we don't have UTF-8 code in the
email name check.

Reported-by: Jérémie Dautheribes <jeremie.dautheribes@...tlin.com>
Co-developed-by: Louis Chauvet <louis.chauvet@...tlin.com>
Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
Signed-off-by: Kory Maincent <kory.maincent@...tlin.com>
---
 scripts/checkpatch.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 92669904eecc7..98cc7f6fb8b5f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2979,11 +2979,13 @@ sub process {
 # Check the patch for a From:
 		if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) {
 			$author = $1;
+			$author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
 			my $curline = $linenr;
 			while(defined($rawlines[$curline]) && ($rawlines[$curline++] =~ /^[ \t]\s*(.*)/)) {
-				$author .= $1;
+				my $tmp = $1;
+				$tmp = encode("utf8", decode("MIME-Header", $tmp)) if ($tmp =~ /=\?utf-8\?/i);
+				$author .= $tmp;
 			}
-			$author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
 			$author =~ s/"//g;
 			$author = reformat_email($author);
 		}
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ