The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] tracing: Harden synthetic event string validation and copying
@ 2026-12-01 14:29 Lee Jones
  2026-12-01 14:29 ` [PATCH 1/2] tracing/histograms: Reject non-string fields for synthetic string fields Lee Jones
  2026-12-01 14:29 ` [PATCH 2/2] tracing/synthetic: Bound dynamic string copy to reserved length Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Lee Jones @ 2026-12-01 14:29 UTC (permalink / raw)
  To: lee
  Cc: linux-kernel, linux-trace-kernel, Masami Hiramatsu,
	Mathieu Desnoyers, Steven Rostedt, Tom Zanussi

These two follow-up patches harden synthetic event string handling on
top of the pending read-fault fix ("tracing/synthetic: Handle dynamic
string read faults"):

 1. Reject non-string histogram fields (scalars, constants, and raw
    FILTER_PTR_STRING pointers) when matching synthetic string fields
    in check_synth_field(), mirroring the stacktrace validation fix in
    commit a244c241593b ("tracing/histograms: Reject non-stacktrace
    fields for synthetic stacktrace fields").  Note that syscall
    FILTER_PTR_STRING fields (such as sys_enter_openat's filename) are
    intentionally rejected here because user-controlled pointers can
    carry arbitrary kernel addresses into fetch_store_string(); passing
    them as u64 and reading them with a :ustring eprobe remains
    unaffected.

 2. Eliminate the TOCTOU ring-buffer and perf-buffer overflow in
    trace_string() (reported by Sashiko) by measuring each dynamic
    string once during the sizing pass and bounding fetch_store_string()
    to the per-field reserved length.

Patch 1 applies independently to trace/for-next; patch 2 is based on
"[RESEND] tracing/synthetic: Handle dynamic string read faults".

Cc: linux-trace-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tom.zanussi@linux.intel.com>

Lee Jones (2):
  tracing/histograms: Reject non-string fields for synthetic string
    fields
  tracing/synthetic: Bound dynamic string copy to reserved length

 kernel/trace/trace_events_hist.c  | 11 ++++--
 kernel/trace/trace_events_synth.c | 66 +++++++++++++++++++++----------
 2 files changed, 53 insertions(+), 24 deletions(-)

-- 
2.56.1.839.g22a8290db9-goog

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-01 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 14:29 [PATCH 0/2] tracing: Harden synthetic event string validation and copying Lee Jones
2026-12-01 14:29 ` [PATCH 1/2] tracing/histograms: Reject non-string fields for synthetic string fields Lee Jones
2026-12-01 14:29 ` [PATCH 2/2] tracing/synthetic: Bound dynamic string copy to reserved length Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox