summaryrefslogtreecommitdiff
path: root/scripts/basic/split-include.c
diff options
context:
space:
mode:
authorJose Fernandez (Anthropic) <jose.fernandez@linux.dev>2026-09-24 22:35:45 +0000
committerSteven Rostedt <rostedt@goodmis.org>2026-10-19 10:27:53 -0400
commit6703ab347f4b7c228bbe391dafbe57b1a62b2997 (patch)
treebe6e8ebed1b18dc27cc4fbe283de27c8226c9fa7 /scripts/basic/split-include.c
parent1054e526ce4e428562b8084f6ee4ef1721a5675c (diff)
downloadlinux-6703ab347f4b7c228bbe391dafbe57b1a62b2997.tar.gz
linux-6703ab347f4b7c228bbe391dafbe57b1a62b2997.zip
ftrace: Do not leak a module's empty page group
When every mcount_loc entry of a module is skipped, ftrace_process_locs() leaves the module's first page group linked with no records. ftrace_release_mod() matches a module's groups by records[0].ip, which is 0 here, so the group is never freed. While it stays linked, ftrace_free_mem() reads pg->records[pg->index - 1] with pg->index == 0 on every later module load, as lookup_rec() did before commit ee92fa443358f ("ftrace: Fix invalid address access in lookup_rec() when index is 0"). Unlink and free the new page groups when none of them got a record. Link: https://patch.msgid.link/20260924-b4-arm64-callops-kcfi-v2-1-587865b6d991@linux.dev Reported-by: sashiko-bot@kernel.org Closes: https://lore.kernel.org/all/20260904013350.5141B1F000E9@smtp.kernel.org/ Assisted-by: LLM Signed-off-by: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions