* [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs
@ 2025-09-28 4:28 Hugh Dickins
2025-09-28 5:37 ` Nicolas Schier
2025-09-28 12:11 ` Nathan Chancellor
0 siblings, 2 replies; 3+ messages in thread
From: Hugh Dickins @ 2025-09-28 4:28 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Alexey Gladkov, Masahiro Yamada, Stephen Rothwell, Nicolas Shier,
linux-kbuild, linux-kernel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs
2025-09-28 4:28 [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs Hugh Dickins
@ 2025-09-28 5:37 ` Nicolas Schier
2025-09-28 12:11 ` Nathan Chancellor
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Schier @ 2025-09-28 5:37 UTC (permalink / raw)
To: Hugh Dickins
Cc: Nathan Chancellor, Alexey Gladkov, Masahiro Yamada,
Stephen Rothwell, linux-kbuild, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs
2025-09-28 4:28 [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs Hugh Dickins
2025-09-28 5:37 ` Nicolas Schier
@ 2025-09-28 12:11 ` Nathan Chancellor
1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2025-09-28 12:11 UTC (permalink / raw)
To: Nathan Chancellor, Hugh Dickins
Cc: Alexey Gladkov, Masahiro Yamada, Stephen Rothwell, Nicolas Shier,
linux-kbuild, linux-kernel
On Sat, 27 Sep 2025 21:28:06 -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.
>
>
Applied, thanks!
[1/1] modpost: Initialize builtin_modname to stop SIGSEGVs
https://git.kernel.org/kbuild/c/2ea77fca84f07
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-28 12:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-28 4:28 [PATCH next] modpost: Initialize builtin_modname to stop SIGSEGVs Hugh Dickins
2025-09-28 5:37 ` Nicolas Schier
2025-09-28 12:11 ` Nathan Chancellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox