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: <CAMo8BfJOPNaHb0f3Rf2GyhApCDg5bFfCGETWU9-LBJWiJpLeFw@mail.gmail.com>
Date: Fri, 23 Aug 2024 23:41:17 -0700
From: Max Filippov <jcmvbkbc@...il.com>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: kernel test robot <lkp@...el.com>, oe-kbuild-all@...ts.linux.dev, 
	linux-kernel@...r.kernel.org, Pawel Chmielewski <pawel.chmielewski@...el.com>, 
	Jacob Keller <jacob.e.keller@...el.com>, Paul Greenwalt <paul.greenwalt@...el.com>, 
	Simon Horman <horms@...nel.org>, Tony Nguyen <anthony.l.nguyen@...el.com>
Subject: Re: WARNING: [xtensa] modpost: vmlinux: section mismatch in
 reference: ice_adv_lnk_speed_maps+0x14 (section: .data) ->
 __setup_str_initcall_blacklist (section: .init.rodata)

Hi Przemek,

On Thu, Aug 22, 2024 at 1:23 AM Przemek Kitszel
<przemyslaw.kitszel@...el.com> wrote:
> > WARNING: modpost: missing MODULE_DESCRIPTION() in vmlinux.o
> > WARNING: modpost: vmlinux: section mismatch in reference: put_page+0x78 (section: .text.unlikely) -> initcall_level_names (section: .init.data)
> >>> WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
>
> I have spent just half of hour on that and I'm clueless.
>
> For reference, the driver code is:
>         static const u32 arr_name[] __initconst = {
>                 SOME_CONST,
>         };
> and core kernel has:
>         #define __initconst __section(.init.rodata)
>
>
> @Max Filippov, you have authored much of xtensa arch for kernel,
> especially XIP support, and touched .init.rodata back then;
> perhaps you have any idea what is going here?

I see the following:

static struct ethtool_forced_speed_map ice_adv_lnk_speed_maps[]
__ro_after_init = {
       ETHTOOL_FORCED_SPEED_MAP(ice_adv_lnk_speed, 100),

that array goes into the .data, but ETHTOOL_FORCED_SPEED_MAP
expands to the following:

#define ETHTOOL_FORCED_SPEED_MAP(prefix, value)                         \
{                                                                       \
       .speed          = SPEED_##value,                                \
       .cap_arr        = prefix##_##value,                             \
       .arr_size       = ARRAY_SIZE(prefix##_##value),                 \
}

so the first entry of that array quoted above above gets the following
initializer:

  .cap_arr = ice_adv_lnk_speed_100,

and ice_adv_lnk_speed_100 is defined as

  static const u32 ice_adv_lnk_speed_100[] __initconst = {

so this array goes into .init.rodata.
That's a reference from .data to .init.rodata that upsets the modpost checker.
I see that modpost incorrectly deduces where this link points (it's
ice_adv_lnk_speed_*, not __setup_str_initcall_blacklist).
I also see that this link is not used after the init phase, so it's harmless.

-- 
Thanks.
-- Max

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ