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: <20230930140601.2457711-1-u.kleine-koenig@pengutronix.de>
Date:   Sat, 30 Sep 2023 16:06:01 +0200
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Arnd Bergmann <arnd@...db.de>, coresight@...ts.linaro.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        James Clark <james.clark@....com>, kernel@...gutronix.de,
        Leo Yan <leo.yan@...aro.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kbuild@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Mike Leach <mike.leach@...aro.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nicolas Schier <nicolas@...sle.eu>,
        Suzuki K Poulose <suzuki.poulose@....com>
Subject: [PATCH] modpost: Don't let "driver"s reference .exit.*



Drivers must not reference functions marked with __exit as these likely
are not available when the code is built-in.

As of v6.6-rc3 building an allyesconfig on arm64, m68k, powerpc, riscv,
s390, sparc64 and x86_64 this now stricter check only triggers for a
single driver (drivers/hwtracing/coresight/coresight-etm4x-core.c). This
one is indeed broken, a fix was already posted
(https://lore.kernel.org/linux-arm-kernel/20230929081637.2377335-1-u.kleine-koenig@pengutronix.de).

This matches commit 0db252452378 ("modpost: don't allow *driver to
reference .init.*") which only handled .init.*.

Thanks to Masahiro Yamada and Arnd Bergmann who gave valuable hints to
find this improvement.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
---
 scripts/mod/modpost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index de499dce5265..b17665e902fc 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1017,7 +1017,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
 
 	/* symbols in data sections that may refer to meminit/exit sections */
 	if (match(fromsec, PATTERNS(DATA_SECTIONS)) &&
-	    match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_EXIT_SECTIONS)) &&
+	    match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_XXXEXIT_SECTIONS)) &&
 	    match(fromsym, PATTERNS("*driver")))
 		return 0;
 
-- 
2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ