From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: [PATCH v3 00/13] tracing/probes: Fix various bugs in dynamic probe events
Date: Fri, 13 Nov 2026 17:27:59 +0900 [thread overview]
Message-ID: <179455847934.403392.15146485751358774349.stgit@devnote2> (raw)
Hi,
This is the 3rd version of the series fixing several bugs in dynamic
probe events (kprobe, fprobe, uprobe, and eprobe) and BTF/fetch-argument
handling.
Here is the previous version:
https://lore.kernel.org/all/179444679892.345731.5271591537517106679.stgit@devnote2/
This version updates [03/13] to fix BTF bitfield handling for kflag=0
bit offsets, non-power-of-2 container sizes, and big-endian bitfields
pointed out by Sashiko.
- [01/13] Check whether the target event is enabled or busy before
unlinking a sibling probe during multiprobe unregistration, and add
the missing checks to trace_uprobe and trace_eprobe.
- [02/13] Enable newly appended fprobes and uprobes immediately when
the target multiprobe event is already enabled, matching trace_kprobe
behavior.
- [03/13] Fix BTF bitfield parsing for non-kflag bitfields (such as
enum bitfields, non-byte-aligned offsets, and non-power-of-2 sizes),
select a narrow container fetch type to avoid out-of-bounds buffer
writes, and compute bitfield extraction parameters from the container
width for both big- and little-endian bitfields.
- [04/13] Add missing BTF_KIND_PTR, NULL, and BTF_KIND_INT checks in
btf_type_is_char_ptr() and btf_type_is_char_array().
- [05/13] Use explicit fixed-width integer types (s8/u8, s16/u16,
s32/u32) in eprobe get_event_field() so 1-byte signed fields are
properly sign-extended under -funsigned-char.
- [06/13] Disallow attaching eprobes to fprobe events to prevent
potential recursion issues, matching kprobes and uprobes.
- [07/13] Check FETCH_OP_UDEREF before advancing the fetch instruction
pointer in finalize_fetch_insn() so user-space dereference string
arrays emit FETCH_OP_ST_USTRING instead of FETCH_OP_ST_STRING.
- [08/13] Reject array specifiers on non-dereference string sources
(such as $comm or symstr) in finalize_fetch_insn().
- [09/13] Fix memory leak of tail in __trace_uprobe_create() when
generating a default event name.
Minor updates/cleanups:
- [10/13] Allow the symstr type on function entry arguments ($argN) in
return probes (FETCH_OP_EDATA).
- [11/13] Reject empty fetch expressions before :%pd and :%pD in
traceprobe_expand_dentry_args().
- [12/13] Validate the command prefix in kprobe, uprobe, and eprobe
creation when the colon separator is omitted so invalid prefixes are
rejected.
- [13/13] Propagate actual error return codes in eprobe and fprobe
creation paths instead of overwriting them with -EINVAL.
Changes in v3:
- [03/13] Use ctx->last_bitoffs as code->lshift on
__BIG_ENDIAN_BITFIELD architectures in parse_btf_bitfield(), and fold
BTF_INT_OFFSET(intdata) into bitoffs before checking alignment and
!is_power_of_2(type->size) in get_bitoffset_of_field().
Changes in v2:
- [03/13] Check (bitoffs % 8) in get_bitoffset_of_field() so unaligned
byte-sized kflag=0 bitfields also record ctx->last_bitsize.
- [08/13] Add Fixes and Cc: stable tags.
- [09/13] Newly added to fix tail memory leak in
__trace_uprobe_create().
Notes:
- These bugs were identified and the fixes and cover letter were
prepared with the assistance of an LLM coding assistant.
Thank you,
---
base-commit: be94710b1f6ba1bea33e73129c110af80e999b2d
Masami Hiramatsu (Google) (13):
tracing/probes: Check enabled and busy state before unlinking sibling probes
tracing/probes: Enable newly appended probe when target event is enabled
tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write
tracing/probes: Fix missing BTF kind checks in char pointer/array helpers
tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()
tracing/eprobe: Disallow attaching eprobes to fprobe events
tracing/probes: Fix user-space dereference string array store type
tracing/probes: Reject array count on non-dereference string sources
tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create()
tracing/probes: Allow symstr type for function entry arguments in return probes
tracing/probes: Reject empty fetch expression for %pd and %pD
tracing/probes: Validate command prefix in kprobe, uprobe, and eprobe
tracing/probes: Propagate error codes in eprobe and fprobe creation
kernel/trace/trace_eprobe.c | 39 +++++++++++-------
kernel/trace/trace_fprobe.c | 26 +++++-------
kernel/trace/trace_kprobe.c | 11 +++--
kernel/trace/trace_probe.c | 94 ++++++++++++++++++++++++++++++++++---------
kernel/trace/trace_uprobe.c | 79 ++++++++++++++++++++++++------------
5 files changed, 171 insertions(+), 78 deletions(-)
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next reply other threads:[~2026-11-13 8:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 8:27 Masami Hiramatsu (Google) [this message]
2026-11-13 8:28 ` [PATCH v3 01/13] tracing/probes: Check enabled and busy state before unlinking sibling probes Masami Hiramatsu (Google)
2026-11-13 8:28 ` [PATCH v3 02/13] tracing/probes: Enable newly appended probe when target event is enabled Masami Hiramatsu (Google)
2026-11-13 8:28 ` [PATCH v3 03/13] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Masami Hiramatsu (Google)
2026-11-13 8:28 ` [PATCH v3 04/13] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers Masami Hiramatsu (Google)
2026-11-13 8:28 ` [PATCH v3 05/13] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Masami Hiramatsu (Google)
2026-11-13 8:28 ` [PATCH v3 06/13] tracing/eprobe: Disallow attaching eprobes to fprobe events Masami Hiramatsu (Google)
2026-11-13 8:29 ` [PATCH v3 07/13] tracing/probes: Fix user-space dereference string array store type Masami Hiramatsu (Google)
2026-11-13 8:29 ` [PATCH v3 08/13] tracing/probes: Reject array count on non-dereference string sources Masami Hiramatsu (Google)
2026-11-13 8:29 ` [PATCH v3 09/13] tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create() Masami Hiramatsu (Google)
2026-11-13 8:29 ` [PATCH v3 10/13] tracing/probes: Allow symstr type for function entry arguments in return probes Masami Hiramatsu (Google)
2026-11-13 8:39 ` sashiko-bot
2026-11-13 8:29 ` [PATCH v3 11/13] tracing/probes: Reject empty fetch expression for %pd and %pD Masami Hiramatsu (Google)
2026-11-13 8:29 ` [PATCH v3 12/13] tracing/probes: Validate command prefix in kprobe, uprobe, and eprobe Masami Hiramatsu (Google)
2026-11-13 8:29 ` [PATCH v3 13/13] tracing/probes: Propagate error codes in eprobe and fprobe creation Masami Hiramatsu (Google)
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=179455847934.403392.15146485751358774349.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.org \
/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.