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: <20240613000327.GB1596562@thelio-3990X>
Date: Wed, 12 Jun 2024 17:03:27 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Uwe Kleine-König <u.kleine-koenig@...libre.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>,
	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: Re: [PATCH] modpost: Enable section warning from *driver to
 .exit.text

On Tue, Jun 11, 2024 at 10:59:00PM +0200, Uwe Kleine-König wrote:
> 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>

Seems reasonable to me, this is just a modpost warning, so it should not
matter too much if there are a few instances lagging behind for a bit
(but it would be good for that to get back on people's radar).

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

> ---
> 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