linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Suchánek" <msuchanek@suse.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-modules@vger.kernel.org
Subject: Re: [PATCH] modinfo: don't parse built-in for explicitly given module files
Date: Wed, 18 Aug 2021 13:41:39 +0200	[thread overview]
Message-ID: <20210818114139.GG153889@kunlun.suse.cz> (raw)
In-Reply-To: <20210818112203.24863-1-tiwai@suse.de>

On Wed, Aug 18, 2021 at 01:22:03PM +0200, Takashi Iwai wrote:
> A recent bug report showed that modinfo doesn't give the signature
> information for certain modules, and it turned out to happen only on
> the modules that are built-in on the running kernel; then modinfo
> skips the signature check, as if the target module file never exists.
> The behavior is, however, inconsistent when modinfo is performed for
> external modules (no matter which kernel version is) and the module
> file path is explicitly given by a command-line argument, which
> guarantees the presence of the module file itself.
> 
> This patch addresses the regression by checking the presence of the
> module path at first before checking the built-in module.
> 
> Fixes: e7e2cb61fa9f ("modinfo: Show information about built-in modules")
> BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1189537
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Reviewed-by: Michal Suchánek <msuchanek@suse.de>

LGTM

Thanks
> ---
>  libkmod/libkmod-module.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
> index 6e0ff1a99604..9e878a5345a1 100644
> --- a/libkmod/libkmod-module.c
> +++ b/libkmod/libkmod-module.c
> @@ -2292,7 +2292,8 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
>  	assert(*list == NULL);
>  
>  	/* remove const: this can only change internal state */
> -	if (kmod_module_is_builtin((struct kmod_module *)mod)) {
> +	if (!kmod_module_get_path(mod) &&
> +	    kmod_module_is_builtin((struct kmod_module *)mod)) {
>  		count = kmod_builtin_get_modinfo(mod->ctx,
>  						kmod_module_get_name(mod),
>  						&strings);
> -- 
> 2.26.2
> 

  reply	other threads:[~2021-08-18 11:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 11:22 Takashi Iwai
2021-08-18 11:41 ` Michal Suchánek [this message]
2021-08-18 12:05 ` Petr Vorel
2021-08-18 19:13 ` Lucas De Marchi
2021-08-18 20:52   ` [PATCH] libkmod: Set builtin to no when module is created from path Michal Suchanek
2021-08-18 21:23     ` Lucas De Marchi
2021-08-18 21:24     ` [PATCH v2] " Lucas De Marchi
2021-08-18 21:24       ` [PATCH] " Lucas De Marchi
2021-08-19 15:28       ` [PATCH v2] " Petr Vorel

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=20210818114139.GG153889@kunlun.suse.cz \
    --to=msuchanek@suse.de \
    --cc=linux-modules@vger.kernel.org \
    --cc=tiwai@suse.de \
    --subject='Re: [PATCH] modinfo: don'\''t parse built-in for explicitly given module files' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).