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: <CAK7LNATY+11zvrpfGnnxFENKyXjKC2qfmt3-i5tjVjHs9wiZKg@mail.gmail.com>
Date: Fri, 6 Jun 2025 20:20:06 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Alexey Gladkov <legion@...nel.org>
Cc: Petr Pavlu <petr.pavlu@...e.com>, Luis Chamberlain <mcgrof@...nel.org>, 
	Sami Tolvanen <samitolvanen@...gle.com>, Daniel Gomez <da.gomez@...sung.com>, 
	Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas.schier@...ux.dev>, 
	linux-kernel@...r.kernel.org, linux-modules@...r.kernel.org, 
	linux-kbuild@...r.kernel.org
Subject: Re: [PATCH v3 3/6] modpost: Make mod_device_table aliases more unique

On Fri, Jun 6, 2025 at 2:10 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> On Wed, Jun 4, 2025 at 8:26 PM Alexey Gladkov <legion@...nel.org> wrote:
> >
> > On Tue, Jun 03, 2025 at 01:18:25AM +0900, Masahiro Yamada wrote:
> > > > > > Before these patches this was not a problem as non-unique characters are
> > > > > > in separate object files when the module is compiled separately.
> > > > > >
> > > > > > But when the modules are compiled into the kernel, there is a symbol
> > > > > > conflict when linking vmlinuz. We have modules that export multiple device
> > > > > > tables from different object files.
> > > > >
> > > > > This is because the __mod_device_table__* symbols are global, but
> > > > > I suspect they do not need to be.
> > > > >
> > > > > Let's test this
> > > > > https://lore.kernel.org/lkml/20250602105539.392362-1-masahiroy@kernel.org/T/#u
> > > >
> > > > I tested this patch with the config:
> > > >
> > > > make allmodconfig
> > > > make mod2yesconfig
> > > >
> > > > and it works.
> > >
> > > Good.
> > > Then, __COUNTER__ is unnecessary.
> >
> > I didn't immediately notice. The patch you suggested works, but these
> > symbols remain in System.map and it seems in vmlinuz.
> >
>
> Ah, yes, if your patch set is applied.
>
> Currently, MODULE_DEVICE_TABLE() is no-op in vmlinux.
>
> This makes me realize that your v3 4/6
> increased the vmlinux image, as MODULE_DEVICE_TABLE()
> is kept for modpost.


With your patch set, __mod_device_table_* will be
included in vmlinux.

My patch changes them from global to local  ('D' is changed to 'd'),
but there is no difference in the fact that v3 4/6 will grow
the symbol table in vmlinux.




(1) Your patch set

$ arm-linux-gnueabihf-nm  vmlinux | grep __mod_device | head -n 10
c0527678 D __mod_device_table__164__kmod_clk_scmi__scmi__scmi_id_table
c053f458 D __mod_device_table__164__kmod_reset_scmi__scmi__scmi_id_table
c05421bc D __mod_device_table__164__kmod_reset_uniphier_glue__of__uniphier_glue_reset_match
c05334ac D __mod_device_table__164__kmod_scmi_pm_domain__scmi__scmi_id_table
c054cbd0 D __mod_device_table__164__kmod_twl4030_power__of__twl4030_power_of_match
c0548e8c D __mod_device_table__165__kmod_omap3_rom_rng__of__omap_rom_rng_match
c05124a0 D __mod_device_table__165__kmod_simple_pm_bus__of__simple_pm_bus_of_match
c05559ac D __mod_device_table__165__kmod_timer_ti_dm__of__omap_timer_match
c0528a68 D __mod_device_table__166__kmod_adpll__of__ti_adpll_match
c0520a68 D __mod_device_table__166__kmod_gpio_en7523__of__airoha_gpio_of_match

(2) Your patch set + my one (extern -> static)

$ arm-linux-gnueabihf-nm  vmlinux | grep __mod_device | head -n 10
c0527678 d __mod_device_table__164__kmod_clk_scmi__scmi__scmi_id_table
c053f458 d __mod_device_table__164__kmod_reset_scmi__scmi__scmi_id_table
c05421bc d __mod_device_table__164__kmod_reset_uniphier_glue__of__uniphier_glue_reset_match
c05334ac d __mod_device_table__164__kmod_scmi_pm_domain__scmi__scmi_id_table
c054cbd0 d __mod_device_table__164__kmod_twl4030_power__of__twl4030_power_of_match
c0548e8c d __mod_device_table__165__kmod_omap3_rom_rng__of__omap_rom_rng_match
c05124a0 d __mod_device_table__165__kmod_simple_pm_bus__of__simple_pm_bus_of_match
c05559ac d __mod_device_table__165__kmod_timer_ti_dm__of__omap_timer_match
c0528a68 d __mod_device_table__166__kmod_adpll__of__ti_adpll_match
c0520a68 d __mod_device_table__166__kmod_gpio_en7523__of__airoha_gpio_of_match












-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ