public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Vincent Donnefort <vdonnefort@google.com>
Cc: Mostafa Saleh <smostafa@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev,
	catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev,
	joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com,
	tabba@google.com
Subject: Re: [PATCH] KVM: arm64: Harden clock for nvhe/pKVM
Date: Wed, 06 May 2026 16:34:46 +0100	[thread overview]
Message-ID: <86zf2cy2jt.wl-maz@kernel.org> (raw)
In-Reply-To: <aftc7n_-43ozFFbl@google.com>

On Wed, 06 May 2026 16:23:26 +0100,
Vincent Donnefort <vdonnefort@google.com> wrote:
> 
> On Wed, May 06, 2026 at 04:10:20PM +0100, Mostafa Saleh wrote:
> > On Wed, May 6, 2026 at 4:03 PM Vincent Donnefort <vdonnefort@google.com> wrote:
> > >
> > > On Thu, Apr 30, 2026 at 10:37:24AM +0000, Mostafa Saleh wrote:
> > > > Sashiko(locally) reports possiblity of division by zero and
> > > > out-of-bounds bitwise shift in trace_clock_update().
> > > >
> > > > Although the clock update is untrusted, we should at least have some
> > > > basic checks to avoid the clock value getting out of sync if the host
> > > > is buggy.
> 
> > >
> > > I am not sure about the gain here. The host can still write values that will
> > > make it out of sync anyway.
> > >
> > > The timestamp is ultimately fed and read by the host.
> > >
> > 
> > This is not about having the clock in sync, but to avoid executing
> > undefined behavior, such as division by zero or large shifts in cases
> > if the host is buggy and not malicious.
> > That was reported by Sashiko
> > https://sashiko.dev/#/patchset/20260501111928.259252-1-smostafa%40google.com
> > 
> > Thanks,
> > Mostafa
> 
> I would then reword that to make it clear it just prevents the host triggering
> UB on the hypervisor. It doesn't really harden much, which is fine because that
> data isn't relevant for the hypervisor.

I can repaint the commit message when applying this.

> 
> Other than that:
> 
> Reviewed-by: Vincent Donnefort <vdonnefort@google.com>

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2026-05-06 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 10:37 [PATCH] KVM: arm64: Harden clock for nvhe/pKVM Mostafa Saleh
2026-05-06 15:03 ` Vincent Donnefort
2026-05-06 15:10   ` Mostafa Saleh
2026-05-06 15:23     ` Vincent Donnefort
2026-05-06 15:34       ` Marc Zyngier [this message]
2026-05-06 16:14 ` Marc Zyngier

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=86zf2cy2jt.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=smostafa@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.com \
    --cc=vdonnefort@google.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox