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] [day] [month] [year] [list]
Message-ID: <Zy0bicseNf0yqxlz@darkstar.musicnaut.iki.fi>
Date: Thu, 7 Nov 2024 21:56:57 +0200
From: Aaro Koskinen <aaro.koskinen@....fi>
To: Geert Uytterhoeven <geert+renesas@...der.be>
Cc: Dominik Brodowski <linux@...inikbrodowski.net>,
	Uwe Kleine-König <ukleinek@...nel.org>,
	Janusz Krzysztofik <jmkrzyszt@...il.com>,
	Tony Lindgren <tony@...mide.com>, linux-omap@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pcmcia: omap_cf: : Mark driver struct with __refdata to
 prevent section mismatch

Hi,

On Wed, Nov 06, 2024 at 01:13:57PM +0100, Geert Uytterhoeven wrote:
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via platform_driver_probe().  Make this explicit
> to prevent the following section mismatch warning
> 
>     WARNING: modpost: drivers/pcmcia/omap_cf: section mismatch in reference: omap_cf_driver+0x4 (section: .data) -> omap_cf_remove (section: .exit.text)
> 
> that triggers on an omap1_defconfig + CONFIG_OMAP_CF=m build.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>

Acked-by: Aaro Koskinen <aaro.koskinen@....fi>

A.

> ---
>  drivers/pcmcia/omap_cf.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
> index 80137c7afe0d9bcf..938fad9c12aa8a4e 100644
> --- a/drivers/pcmcia/omap_cf.c
> +++ b/drivers/pcmcia/omap_cf.c
> @@ -302,7 +302,13 @@ static void __exit omap_cf_remove(struct platform_device *pdev)
>  	kfree(cf);
>  }
>  
> -static struct platform_driver omap_cf_driver = {
> +/*
> + * omap_cf_remove() lives in .exit.text. For drivers registered via
> + * platform_driver_probe() this is ok because they cannot get unbound at
> + * runtime. So mark the driver struct with __refdata to prevent modpost
> + * triggering a section mismatch warning.
> + */
> +static struct platform_driver omap_cf_driver __refdata = {
>  	.driver = {
>  		.name	= driver_name,
>  	},
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ