All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: linux-modules@vger.kernel.org
Subject: Re: [PATCH v2 1/2] module: remove MODULE_VERSION()
Date: Fri, 31 Jul 2026 13:18:54 +0000	[thread overview]
Message-ID: <20260731131854.B085B1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260731-module_ver_remove-v2-1-c9163858f382@linuxfoundation.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] Immediate, unphased removal of the `/sys/module/*/version` sysfs ABI and `modinfo` version outputs.
--

--- Patch [1]: [PATCH v2 1/2] module: remove MODULE_VERSION() ---
commit b77f8591ff850600dbc1da5c9c2f45e06be183fe
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

module: remove MODULE_VERSION()

This commit removes the MODULE_VERSION macro and its associated sysfs
attributes. It redefines the macro to be empty to keep existing code
building while it is phased out, as module versions do not make sense in
a unified build.

Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>
Cc: Daniel Gomez <da.gomez@kernel.org>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Aaron Tomlin <atomlin@atomlin.com>
Cc: Shyam Saini <shyamsaini@linux.microsoft.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>

[ ... ]
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 7566815fabbe8..209b6a388be7c 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
[ ... ]
> -#if defined(MODULE) || !defined(CONFIG_SYSFS)
> -#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
> -#else
> -#define MODULE_VERSION(_version)					\
> -	MODULE_INFO(version, _version);					\
> -	static const struct module_version_attribute __modver_attr	\
> -		__used __section("__modver")				\
> -		__aligned(__alignof__(struct module_version_attribute)) \
> -		= {							\
> -			.mattr	= {					\
> -				.attr	= {				\
> -					.name	= "version",		\
> -					.mode	= S_IRUGO,		\
> -				},					\
> -				.show	= __modver_version_show,	\
> -			},						\
> -			.module_name	= KBUILD_MODNAME,		\
> -			.version	= _version,			\
> -		}
> -#endif
> +#define MODULE_VERSION(_version)

[Severity: Critical]
Does redefining this macro to empty immediately prevent the version tag from
being embedded in the .modinfo section of all loadable modules? Could this
cause a regression for userspace tools like modinfo that might rely on
extracting this information?

[ ... ]
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index 46dd8d25a6058..da8be9788d130 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
[ ... ]
> @@ -1084,7 +1083,6 @@ static const struct module_attribute modinfo_taint =
>  
>  const struct module_attribute *const modinfo_attrs[] = {
>  	&module_uevent,
> -	&modinfo_version,

[Severity: Critical]
By removing this attribute, does this immediately break the loadable module
sysfs interface at /sys/module/module_name/version? Would it be safer to
provide a backward-compatible stub or deprecation period before completely
removing this stable ABI, to avoid regressions in userspace scripts?

>  	&modinfo_srcversion,
>  	&modinfo_import_ns,
>  	&modinfo_initstate,
[ ... ]
> diff --git a/kernel/params.c b/kernel/params.c
> index a668863a4bb63..6c5a1eb22b257 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
[ ... ]
> -static void __init version_sysfs_builtin(void)
> -{
> -	const struct module_version_attribute *vattr;
> -	struct module_kobject *mk;
> -	int err;
> -
> -	for (vattr = __start___modver; vattr < __stop___modver; vattr++) {
> -		mk = lookup_or_create_module_kobject(vattr->module_name);
> -		if (mk) {
> -			err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr);
> -			WARN_ON_ONCE(err);
> -			kobject_uevent(&mk->kobj, KOBJ_ADD);
> -			kobject_put(&mk->kobj);
> -		}
> -	}
> -}
> -
[ ... ]
> @@ -968,7 +939,6 @@ static int __init param_sysfs_builtin_init(void)
>  	if (!module_kset)
>  		return -ENOMEM;
>  
> -	version_sysfs_builtin();

[Severity: Critical]
Does the removal of this function and its call immediately drop the sysfs
version node for all built-in modules? Could this cause hardware inventory
scripts or udev rules to fail with ENOENT when they expect the file to exist?

>  	param_sysfs_builtin();
>  
>  	return 0;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260731-module_ver_remove-v2-0-c9163858f382@linuxfoundation.org?part=1

  reply	other threads:[~2026-07-31 13:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 13:02 [PATCH v2 0/2] module: remove MODULE_VERSION() and srcversion Greg Kroah-Hartman
2026-07-31 13:02 ` [PATCH v2 1/2] module: remove MODULE_VERSION() Greg Kroah-Hartman
2026-07-31 13:18   ` sashiko-bot [this message]
2026-07-31 13:51     ` Greg Kroah-Hartman
2026-07-31 13:02 ` [PATCH v2 2/2] module: remove srcversion module attribute Greg Kroah-Hartman
2026-07-31 13:35   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260731131854.B085B1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.