Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Aaron Tomlin" <atomlin@atomlin.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 perf-tools-next 7/7] perf trace beauty: Validate payload size in augmented perf_event_open beautifier
Date: Sat, 19 Sep 2026 01:04:56 +0000	[thread overview]
Message-ID: <20260919010457.2E9C91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260919005530.728615-8-atomlin@atomlin.com>

> When pretty-printing augmented perf_event_attr arguments via
> syscall_arg__scnprintf_augmented_perf_event_attr(),
> arg->augmented.args->value is cast to struct perf_event_attr and read
> without verifying that the captured payload is large enough to contain
> at least PERF_ATTR_SIZE_VER0 bytes.
> 
> If a malformed or truncated perf.data record provides an augmented
> payload smaller than PERF_ATTR_SIZE_VER0, accessing attr->size or
> executing memcpy(&local_attr, attr, PERF_ATTR_SIZE_VER0) reads memory
> past the end of the available buffer. Furthermore, when attr->size is
> specified, accessing fields up to attr->size without verifying that
> the captured payload contains at least that many bytes risks out-of-bounds
> reads.
> 
> Validate that arg->augmented.size is at least
> sizeof(struct augmented_arg) + PERF_ATTR_SIZE_VER0. If attr->size is
> non-zero, verify that it is at least PERF_ATTR_SIZE_VER0 and that the
> captured payload contains sufficient bytes before proceeding with
> pretty-printing. If validation fails, fall back to printing the raw
> pointer value.
> 
> Fixes: a9cd6c676685 ("perf trace: Add BPF augmenter to perf_event_open()'s 'struct perf_event_attr' arg")
> Reported-by: sashiko-bot <sashiko-bot@kernel.org>
> Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260919005530.728615-1-atomlin@atomlin.com?part=7


  reply	other threads:[~2026-09-19  1:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19  0:55 [PATCH v3 perf-tools-next 0/7] perf trace: Validate payload bounds across augmented argument beautifiers Aaron Tomlin
2026-09-19  0:55 ` [PATCH v3 perf-tools-next 1/7] perf trace: Add upper bound checks for augmented BTF struct printing Aaron Tomlin
2026-09-19  1:07   ` sashiko-bot
2026-09-19  0:55 ` [PATCH v3 perf-tools-next 2/7] perf trace: Validate payload bounds in augmented string beautifier Aaron Tomlin
2026-09-19  1:08   ` sashiko-bot
2026-09-19  0:55 ` [PATCH v3 perf-tools-next 3/7] perf trace: Align pointer advance " Aaron Tomlin
2026-09-19  1:08   ` sashiko-bot
2026-09-19  0:55 ` [PATCH v3 perf-tools-next 4/7] perf trace: Validate payload bounds in augmented buffer beautifier Aaron Tomlin
2026-09-19  1:09   ` sashiko-bot
2026-09-19  0:55 ` [PATCH v3 perf-tools-next 5/7] perf trace beauty: Validate payload size in augmented timespec beautifier Aaron Tomlin
2026-09-19  1:08   ` sashiko-bot
2026-09-19  0:55 ` [PATCH v3 perf-tools-next 6/7] perf trace beauty: Validate payload size in augmented sockaddr beautifier Aaron Tomlin
2026-09-19  1:05   ` sashiko-bot
2026-09-19  0:55 ` [PATCH v3 perf-tools-next 7/7] perf trace beauty: Validate payload size in augmented perf_event_open beautifier Aaron Tomlin
2026-09-19  1:04   ` sashiko-bot [this message]
2026-09-30 18:29 ` [PATCH v3 perf-tools-next 0/7] perf trace: Validate payload bounds across augmented argument beautifiers Aaron Tomlin

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=20260919010457.2E9C91F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=atomlin@atomlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox