From: sashiko-bot@kernel.org
To: "Usama Arif" <usama.arif@linux.dev>, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf/x86/amd/ibs: Don't leak stack contents through PERF_SAMPLE_WEIGHT_STRUCT
Date: Mon, 23 Nov 2026 16:31:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-229661@kernel.org> (raw)
In-Reply-To: <20261123162315.1142701-1-usama.arif@linux.dev>
> For a load that missed the data cache, perf_ibs_parse_ld_st_data()
> reports the miss latency as the sample weight and marks
> PERF_SAMPLE_WEIGHT_TYPE as done, so perf_prepare_sample() leaves the
> field alone. With PERF_SAMPLE_WEIGHT_STRUCT it writes only var1_dw and
> var2_w, but perf_output_sample() copies all 8 bytes of the union into
> the ring buffer. var3_w therefore carries whatever was left in the
> on-stack struct perf_sample_data in perf_ibs_handle_irq().
>
> CONFIG_INIT_STACK_ALL_ZERO hides this by clearing the struct on entry.
> Without it, every such sample hands 2 bytes of kernel stack to user
> space. "perf mem record" asks for PERF_SAMPLE_WEIGHT_STRUCT on x86, and
> since v6.14 swfilt lets an unprivileged user sample their own tasks with
> IBS.
>
> Write var3_w as well.
>
> Fixes: 6b2ae4952ef8 ("perf/x86/amd: Support PERF_SAMPLE_{WEIGHT|WEIGHT_STRUCT}")
> Cc: stable@vger.kernel.org
> Signed-off-by: Usama Arif <usama.arif@linux.dev>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123162315.1142701-1-usama.arif@linux.dev?part=1
next prev parent reply other threads:[~2026-11-23 16:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 16:23 [PATCH] perf/x86/amd/ibs: Don't leak stack contents through PERF_SAMPLE_WEIGHT_STRUCT Usama Arif
2026-11-23 16:31 ` sashiko-bot [this message]
2026-11-27 12:16 ` Ravi Bangoria
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=sashiko-outbox-229661@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=usama.arif@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 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.