summaryrefslogtreecommitdiff
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2025-09-27 21:28:06 -0700
committerNathan Chancellor <nathan@kernel.org>2025-09-28 07:54:07 -0400
commit2ea77fca84f07849aa995271271340d262d0c2e9 (patch)
tree34b3605fc1ea9a0dff05917a5f2a8c0b6c2e6bd6 /scripts/mod/file2alias.c
parent37fac070eb1e59db81a9b3b18340083878a0a2c9 (diff)
modpost: Initialize builtin_modname to stop SIGSEGVs
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> Reviewed-by: Nicolas Schier <nsc@kernel.org> Link: https://patch.msgid.link/4590a243-0a7e-b7e6-e2d3-cd1b41a12237@google.com Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c1
1 files changed, 1 insertions, 0 deletions
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);
}