Linux Trace Kernel
 help / color / mirror / Atom feed
From: Maurice Hieronymus <mhi@mailbox.org>
To: ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com,
	andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com,
	song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org,
	sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org,
	rostedt@goodmis.org, mhiramat@kernel.org, mark.rutland@arm.com,
	mathieu.desnoyers@efficios.com
Cc: georges.aureau@hpe.com, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	mhi@mailbox.org
Subject: [PATCH v4 0/2] kallsyms: Always initialize modbuildid
Date: Sat, 20 Dec 2025 19:18:36 +0100	[thread overview]
Message-ID: <20251220181838.63242-1-mhi@mailbox.org> (raw)

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.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220717

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
-- 
2.50.1


             reply	other threads:[~2025-12-20 18:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-20 18:18 Maurice Hieronymus [this message]
2025-12-20 18:18 ` [PATCH v4 1/2] kallsyms: Always initialize modbuildid on ftrace address Maurice Hieronymus
2026-01-07 19:44   ` Steven Rostedt
2025-12-20 18:18 ` [PATCH v4 2/2] kallsyms: Always initialize modbuildid on bpf address Maurice Hieronymus
2025-12-21 18:17   ` Alexei Starovoitov
2025-12-21 18:44 ` [PATCH v4 0/2] kallsyms: Always initialize modbuildid Maurice Hieronymus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251220181838.63242-1-mhi@mailbox.org \
    --to=mhi@mailbox.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=georges.aureau@hpe.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.lau@linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox