Skip to content

kallsyms: Always initialize modbuildid

Maurice Hieronymus bpf linux-trace-kernel lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 3 repliesIn review
  2. v31 patch 2 repliesSuperseded
  3. v21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch0 repliesSuperseded

Changes to v3 from the cover letter

- Split the changes into separate ftrace and bpf patches
- Replace IS_ENABLED() with plain #ifdef

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2kallsyms: Always initialize modbuildid on ftrace addressinclude/linux/ftrace.h kernel/kallsyms.c kernel/trace/ftrace.c+10 -41 reply
2/2kallsyms: Always initialize modbuildid on bpf addressinclude/linux/filter.h kernel/kallsyms.c+5 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/2] kallsyms: Always initialize modbuildid

modbuildid is never set when kallsyms_lookup_buildid is returning via successful bpf_address_lookup or ftrace_mod_address_lookup.

This leads to an uninitialized pointer dereference on x86 when CONFIG_STACKTRACE_BUILD_ID=y inside __sprint_symbol.

Prevent this by always initializing modbuildid.

Changes to v3:
- Split the changes into separate ftrace and bpf patches
- Replace IS_ENABLED() with plain #ifdef

Maurice Hieronymus (2):
kallsyms: Always initialize modbuildid on ftrace address
kallsyms: Always initialize modbuildid on bpf address

 include/linux/filter.h | 6 ++++--
 include/linux/ftrace.h | 4 ++--
 kernel/kallsyms.c      | 4 ++--
 kernel/trace/ftrace.c  | 8 +++++++-
 4 files changed, 15 insertions(+), 7 deletions(-)

base-commit: dd9b004b7ff3289fb7bae35130c0a5c0537266af

Signature · 1 line
2.50.1