From: sashiko-bot@kernel.org
To: "Valentin Schneider" <vschneid@redhat.com>
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v5 8/8] rtla/osnoise: Trace IPI events when recording a trace file
Date: Wed, 02 Sep 2026 13:55:18 +0000 [thread overview]
Message-ID: <20260902135519.1E7C51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260902123942.695822-9-vschneid@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Out-of-bounds read in osnoise_ipi_cpumask_handler due to using CPU_AND on a dynamically sized trace event field.
--
commit 25aed6d1003b38e3162e406562eb91e3fee93066
Author: Valentin Schneider <vschneid@redhat.com>
rtla/osnoise: Trace IPI events when recording a trace file
IPIs can now be monitored and accounted by osnoise top. When that is
the case, also record them when saving a trace file. To match what is
being recorded by the tool for its own analysis, event filters are
applied to the events recorded to the trace output.
> diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c
> index afab2f341a1e9..87d28865515b5 100644
> --- a/tools/tracing/rtla/src/osnoise_top.c
> +++ b/tools/tracing/rtla/src/osnoise_top.c
> @@ -392,7 +392,7 @@ osnoise_ipi_cpumask_handler(struct trace_seq *s, struct tep_record *record,
> */
> struct osnoise_tool *osnoise_init_top(struct common_params *params)
> {
> - bool ipi_filters_enabled = false;
> + bool ipi_filters_enabled;
> struct osnoise_tool *tool;
> int retval;
[Severity: Medium]
Can this lead to an out-of-bounds read when processing the IPI cpumask?
Looking at osnoise_ipi_cpumask_handler() above, it processes the
ipi_send_cpumask trace event:
tools/tracing/rtla/src/osnoise_top.c:osnoise_ipi_cpumask_handler() {
...
cpumask = tep_get_field_raw(s, event, "cpumask", record, &len, 1);
...
event_cpus = (cpu_set_t *)cpumask;
...
CPU_AND(&cpumask_tmp_cpus, event_cpus, ¶ms->common.monitored_cpus);
...
}
tep_get_field_raw() returns a pointer to a dynamically sized field and its
actual length in len.
Since the code ignores len and casts the pointer to a cpu_set_t *, and
glibc's CPU_AND() unconditionally iterates and reads sizeof(cpu_set_t)
(128 bytes) from the source pointers, does this read well past the end
of the trace field for the cpumask (which would be 8 bytes for 64 CPUs)?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260902123942.695822-1-vschneid@redhat.com?part=8
prev parent reply other threads:[~2026-09-02 13:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 12:39 [PATCH v5 0/8] tracing/osnoise: Track IPIs Valentin Schneider
2026-09-02 12:39 ` [PATCH v5 1/8] rtla/osnoise: Add IPI tracking cmdline option Valentin Schneider
2026-09-02 12:39 ` [PATCH v5 2/8] rtla/osnoise: Record IPI count in osnoise top Valentin Schneider
2026-09-02 13:01 ` sashiko-bot
2026-09-02 12:39 ` [PATCH v5 3/8] rtla/osnoise: Leverage IPI event filters when tracing a subset of CPUs Valentin Schneider
2026-09-02 12:39 ` [PATCH v5 4/8] rtla/osnoise: Allow IPI filters to gracefully fail Valentin Schneider
2026-09-02 12:39 ` [PATCH v5 5/8] rtla: make struct trace_events double linked Valentin Schneider
2026-09-02 12:39 ` [PATCH v5 6/8] rtla: Enable and disable events in the user-defined order Valentin Schneider
2026-09-02 12:39 ` [PATCH v5 7/8] rtla: Unconditionally clean any pre-existing filters for user-provided events Valentin Schneider
2026-09-02 13:44 ` sashiko-bot
2026-09-02 12:39 ` [PATCH v5 8/8] rtla/osnoise: Trace IPI events when recording a trace file Valentin Schneider
2026-09-02 13:55 ` sashiko-bot [this message]
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=20260902135519.1E7C51F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vschneid@redhat.com \
/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.