All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: Hugh Dickins <hughd@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Alexey Gladkov <legion@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs
Date: Sun, 28 Sep 2025 07:37:18 +0200	[thread overview]
Message-ID: <aNjJjoEKAzUjhZqj@levanger> (raw)
In-Reply-To: <4590a243-0a7e-b7e6-e2d3-cd1b41a12237@google.com>

On Sat, Sep 27, 2025 at 09:28:06PM -0700, Hugh Dickins wrote:
> Segmentation fault ./scripts/mod/modpost -o vmlinux.symvers vmlinux.o
> stops the kernel build.  It comes when write_vmlinux_export_c_file()
> tries to buf_printf alias->builtin_modname.  malloc'ed memory is not
> necessarily zeroed.  NULL new->builtin_modname before adding to aliases.
> 
> Fixes: 5ab23c7923a1 ("modpost: Create modalias for builtin modules")
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
>  scripts/mod/file2alias.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 7da9735e7ab3..b3333560b95e 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -94,6 +94,7 @@ module_alias_printf(struct module *mod, bool append_wildcard,
>  		}
>  	}
>  
> +	new->builtin_modname = NULL;
>  	list_add_tail(&new->node, &mod->aliases);
>  }
>  
> -- 
> 2.48.2

Thanks!

Reviewed-by: Nicolas Schier <nsc@kernel.org>

-- 
Nicolas

  reply	other threads:[~2025-09-28  5:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-28  4:28 [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs Hugh Dickins
2025-09-28  5:37 ` Nicolas Schier [this message]
2025-09-28 12:11 ` Nathan Chancellor

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=aNjJjoEKAzUjhZqj@levanger \
    --to=nsc@kernel.org \
    --cc=hughd@google.com \
    --cc=legion@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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.