public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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