diff options
| author | Joe Lawrence <joe.lawrence@redhat.com> | 2026-06-26 17:21:40 -0400 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-07-03 13:38:08 -0700 |
| commit | 55caa653014d50a3e10b5dbc282c641cfce5c9f2 (patch) | |
| tree | 89ae6a325ecb862891ef6ffdf6fc1ee0b37abce8 /tools/perf/scripts/python/bin/flamegraph-record | |
| parent | 5a9dd835894cffed85d56aaedc1950bf858ff510 (diff) | |
perf symbols: skip livepatch symbols in kcore_copy kallsyms processing
Livepatch symbols (.klp.sym.*) carry a [module] tag but resolve to core
kernel text addresses. When kcore_copy__process_kallsyms() encounters
these symbols, they are treated as module symbols, pulling the
first_module_symbol down to a kernel text address.
This corrupts the module memory range used to build the kcore PT_LOAD
segments. For example, with a kpatch module containing a
".klp.sym.vmlinux.arch_release_task_struct,0" livepatch symbol loaded:
kernel symbols
...
ffffffffb4a41120 arch_release_task_struct
... ^
... | aliased by .klp.sym
... | drags first_module_symbol here
|
(43M gap) | bloated kcore segment
|
module symbols |
ffffffffc047b000 <-- correct first_module_symbol
...
...
This causes the module PT_LOAD segment to start at the .klp.sym address
and not the real first module address, bloating the kcore copy:
Baseline (no livepatch): VirtAddr ffffffffc047b000, 8.5M
Bloated (with livepatch): VirtAddr ffffffffb4a41000, 54M
Post-fix (with livepatch): VirtAddr ffffffffc047b000, 8.9M
Filter livepatch symbols early in kcore_copy__process_kallsyms() before
they can affect module boundary tracking.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260624201254.472576-1-joe.lawrence@redhat.com?part=1
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/flamegraph-record')
0 files changed, 0 insertions, 0 deletions
