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-next>] [day] [month] [year] [list]
Date:   Tue, 16 Aug 2022 09:51:18 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     linux-kernel@...r.kernel.org
Cc:     Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
        Dwaipayan Ray <dwaipayanray1@...il.com>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: [PATCH] checkpatch: Print an error if rwlock.h is included directly.

rwlock.h shouldn't be included directly in source code. PREEMPT_RT uses
a different implementation and this rwlock.h include breaks it.

Add an error message if linux/rwlock.h is included.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 79e759aac543b..d130db6726414 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5749,6 +5749,12 @@ sub process {
 			}
 		}
 
+# rwlock.h must not be included directly. It will be included via spinlock.h if needed.
+		if ($rawline =~ /\#\s*include.*\<linux\/rwlock\.h/) {
+			ERROR("INCLUDES_BAD_HEADER",
+				"Please don't include rwlock.h directly, use spinlock.h if needed.\n" . $herecurr);
+		}
+
 # warn if <asm/foo.h> is #included and <linux/foo.h> is available and includes
 # itself <asm/foo.h> (uses RAW line)
 		if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
-- 
2.37.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ