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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240611205900.2145880-2-u.kleine-koenig@baylibre.com>
Date: Tue, 11 Jun 2024 22:59:00 +0200
From: Uwe Kleine-König <u.kleine-koenig@...libre.com>
To: Masahiro Yamada <masahiroy@...nel.org>,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>
Cc: Nathan Chancellor <nathan@...nel.org>,
	Nicolas Schier <nicolas@...sle.eu>,
	linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Tom Lendacky <thomas.lendacky@....com>,
	Dan Williams <dan.j.williams@...el.com>,
	Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>,
	"Borislav Petkov (AMD)" <bp@...en8.de>
Subject: [PATCH] modpost: Enable section warning from *driver to .exit.text

There used to be several offenders, but now that for all of them patches
were sent and most of them were applied, enable the warning also for
builds without W=1.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...libre.com>
---
Hello,

as of v6.10-rc2 there are two known offenders:

 - drivers/virt/coco/sev-guest/sev-guest.c
   patch submitted in March, available at
   https://lore.kernel.org/all/4a81b0e87728a58904283e2d1f18f73abc69c2a1.1711748999.git.u.kleine-koenig@pengutronix.de

 - drivers/parport/parport_amiga.c
   fixed in next (commit 73fedc31fed3 ("parport: amiga: Mark driver
   struct with __refdata to prevent section mismatch"))

I tested this patch using allmodconfig builds for arm64, riscv, s390 and
x86_64 which didn't expose further drivers with this problem.

In my eyes this is good enough to enable the warning for all builds (and
not only with W=1).

Best regards
Uwe

 scripts/mod/modpost.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 937294ff164f..30881d94f00e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -965,17 +965,6 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
 	    match(fromsym, PATTERNS("*_ops", "*_probe", "*_console")))
 		return 0;
 
-	/*
-	 * symbols in data sections must not refer to .exit.*, but there are
-	 * quite a few offenders, so hide these unless for W=1 builds until
-	 * these are fixed.
-	 */
-	if (!extra_warn &&
-	    match(fromsec, PATTERNS(DATA_SECTIONS)) &&
-	    match(tosec, PATTERNS(ALL_EXIT_SECTIONS)) &&
-	    match(fromsym, PATTERNS("*driver")))
-		return 0;
-
 	/* Check for pattern 3 */
 	if (strstarts(fromsec, ".head.text") &&
 	    match(tosec, PATTERNS(ALL_INIT_SECTIONS)))

base-commit: c3f38fa61af77b49866b006939479069cd451173
prerequisite-patch-id: 7300dede00db637042647e12d558fe1dd57c20cc
prerequisite-patch-id: 82cfe8597f709f05b9fbbd3e4eca8be35e077e2b
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ