[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aNjJjoEKAzUjhZqj@levanger>
Date: Sun, 28 Sep 2025 07:37:18 +0200
From: Nicolas Schier <nsc@...nel.org>
To: Hugh Dickins <hughd@...gle.com>
Cc: Nathan Chancellor <nathan@...nel.org>,
Alexey Gladkov <legion@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs
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@...gle.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@...nel.org>
--
Nicolas
Powered by blists - more mailing lists