From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Wang Yan <wangyan01@kylinos.cn>,
peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org,
mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, irogers@google.com, james.clark@linaro.org,
atrajeev@linux.ibm.com, tanze@kylinos.cn,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] perf powerpc-vpadtl: Fix off-by-one in auxtrace_info minimum size check
Date: Tue, 8 Sep 2026 17:42:33 -0300 [thread overview]
Message-ID: <aqBzOdmxHyTRoLcG@x2> (raw)
In-Reply-To: <61dff746-7b62-404b-89b2-3c9d73419d71@intel.com>
On Mon, Aug 24, 2026 at 08:55:52AM +0300, Adrian Hunter wrote:
> On 24/08/2026 05:55, Wang Yan wrote:
> > min_sz is set to sizeof(u64) * POWERPC_VPADTL_TYPE, but the code reads
> > auxtrace_info->priv[POWERPC_VPADTL_TYPE], which needs at least
> > POWERPC_VPADTL_TYPE + 1 elements. POWERPC_VPADTL_TYPE is the first
> > enumerator of the priv index enum (0), so min_sz evaluates to 0 and the
> > check validates only the perf_record_auxtrace_info header itself. A
> > PERF_RECORD_AUXTRACE_INFO event carrying a zero-length priv array then
> > passes the size check, and the subsequent priv[POWERPC_VPADTL_TYPE]
> > read runs one u64 past the validated region.
> >
> > This is the same off-by-one fixed for Intel PT by commit c4362d5e1a5e
> > ("perf intel-pt: Fix off-by-one in auxtrace_info minimum size check")
> > and for Intel BTS by commit b9fb8225951c ("perf intel-bts: Fix off-by-one
> > in auxtrace_info minimum size check").
> >
> > Use sizeof(u64) * (POWERPC_VPADTL_TYPE + 1) so the highest accessed
> > priv index is covered by the minimum-size validation.
> >
> > Fixes: c4bbd4ec2e50 ("perf powerpc: Process auxtrace events and display in 'perf report -D'")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Wang Yan <wangyan01@kylinos.cn>
>
> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Thanks, applied to perf-tools-next, for v7.4.
- Arnaldo
prev parent reply other threads:[~2026-09-08 20:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 2:55 [PATCH] perf powerpc-vpadtl: Fix off-by-one in auxtrace_info minimum size check Wang Yan
2026-08-24 3:08 ` sashiko-bot
2026-08-24 5:55 ` Adrian Hunter
2026-09-08 20:42 ` Arnaldo Carvalho de Melo [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=aqBzOdmxHyTRoLcG@x2 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=atrajeev@linux.ibm.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tanze@kylinos.cn \
--cc=wangyan01@kylinos.cn \
/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