From: "Michael S. Tsirkin" <mst@redhat.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Michael Bommarito <michael.bommarito@gmail.com>,
Olivia Mackall <olivia@selenic.com>,
linux-crypto@vger.kernel.org, Jason Wang <jasowang@redhat.com>,
Kees Cook <kees@kernel.org>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
Dan Williams <djbw@kernel.org>, Ingo Molnar <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
torvalds@linux-foundation.org, alan@linux.intel.com,
tglx@linutronix.de
Subject: Re: [PATCH v3] hwrng: virtio: clamp device-reported used.len at copy_data()
Date: Thu, 11 Jun 2026 06:42:56 -0400 [thread overview]
Message-ID: <20260611064040-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <aip9nja-Oz2RxkWi@gondor.apana.org.au>
On Thu, Jun 11, 2026 at 05:19:26PM +0800, Herbert Xu wrote:
> On Thu, Jun 11, 2026 at 05:10:32AM -0400, Michael S. Tsirkin wrote:
> >
> > data_avail is under hypervisor control
> >
> > avail = min_t(unsigned int, vi->data_avail, sizeof(vi->data));
> > if (vi->data_idx >= avail) {
> > vi->data_idx = 0;
> >
> > and maybe this can speculate past the if?
> >
> > I agree, this is all speculation )
>
> Either it is vulnerable to Spectre, or it isn't. Adding nospec
> markers when you're not sure is cargo cult programming.
AKA defence is depth programming)
Alright we can drop this. No biggie.
--
MST
prev parent reply other threads:[~2026-06-11 10:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-31 14:22 [PATCH v3] hwrng: virtio: clamp device-reported used.len at copy_data() Michael Bommarito
2026-06-11 4:43 ` Herbert Xu
2026-06-11 7:30 ` Michael S. Tsirkin
2026-06-11 7:46 ` Herbert Xu
2026-06-11 7:58 ` Michael S. Tsirkin
2026-06-11 8:18 ` Herbert Xu
2026-06-11 9:10 ` Michael S. Tsirkin
2026-06-11 9:19 ` Herbert Xu
2026-06-11 10:42 ` Michael S. Tsirkin [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=20260611064040-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alan@linux.intel.com \
--cc=borntraeger@linux.ibm.com \
--cc=djbw@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=jasowang@redhat.com \
--cc=kees@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.bommarito@gmail.com \
--cc=mingo@redhat.com \
--cc=olivia@selenic.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=virtualization@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 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.