From: sashiko-bot@kernel.org
To: "Adrian Hunter" <adrian.hunter@intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf symbol: Do not use debug file as the binary type
Date: Tue, 25 Aug 2026 06:41:44 +0000 [thread overview]
Message-ID: <20260825064145.3C6E51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825062345.115073-1-adrian.hunter@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch fails to apply the instruction trace fix to kernel modules, leaving them vulnerable to the exact same decoding error.
--
--- Patch [1]: [PATCH] perf symbol: Do not use debug file as the binary type ---
commit af2af0a33f456210f477b124b3165ecd7e50b2ad
Author: Adrian Hunter <adrian.hunter@intel.com>
perf symbol: Do not use debug file as the binary type
This commit updates dso__load() to prefer files that contain executed
instructions over debug-only files (like .gnu-debuglink) for the binary
type. It achieves this by explicitly favoring build ID cache files and
system path DSOs over previously discovered debug files.
Closes: https://lore.kernel.org/all/CAGH6UiG=RJLqBU3kLu9XJciPyPO1HZkbAPERguVUMRuWQgqf=A@mail.gmail.com/
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index 94f9c8faeddab..3587ad2431590 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -1947,7 +1947,16 @@ int dso__load(struct dso *dso, struct map *map)
> if (next_slot) {
> ss_pos++;
>
> - if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND)
> + /*
> + * The binary type is used to find the file containing
> + * the executed instructions, so prefer the types that
> + * refer to the actual object over debug-only files such
> + * as DSO_BINARY_TYPE__DEBUGLINK.
> + */
> + if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND ||
> + symtab_type == DSO_BINARY_TYPE__BUILD_ID_CACHE ||
> + (symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_DSO &&
> + dso__binary_type(dso) != DSO_BINARY_TYPE__BUILD_ID_CACHE))
[Severity: Medium]
Does this new condition also need to check for kernel module object types
like DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE?
If a trace contains kernel module execution and the module's debuginfo is
cached in the perf build-id cache, dso__load() might encounter the
debuginfo file first. When the actual kernel module binary is found
later, the check above will fail because it strictly looks for
DSO_BINARY_TYPE__SYSTEM_PATH_DSO.
Could this leave kernel modules vulnerable to the same decoding errors,
where the debuginfo file is retained and produces wrong instructions
during Intel PT decoding?
> dso__set_binary_type(dso, symtab_type);
>
> if (syms_ss && runtime_ss)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260825062345.115073-1-adrian.hunter@intel.com?part=1
next prev parent reply other threads:[~2026-08-25 6:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 6:23 [PATCH] perf symbol: Do not use debug file as the binary type Adrian Hunter
2026-08-25 6:41 ` sashiko-bot [this message]
2026-08-25 18:13 ` Ian Rogers
2026-08-27 19:36 ` Namhyung Kim
2026-08-30 13:10 ` Arnaldo Carvalho de Melo
2026-09-01 4:14 ` Namhyung Kim
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=20260825064145.3C6E51F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.