From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4892944CF59; Wed, 6 May 2026 15:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778081692; cv=none; b=C2/aOIOZq3LPVxHgtTLmyfKLQWR/1gdvsOySem2U1ZOS5HXrfnxiZlk/LONtgW60Jk6apNrAiHNdUMLwEcYyaEDB0NgIl+H+iaPk2lGkDdclxeS5NEcUtIvTNEYvyRpQ0LeYzRMNZRcLiHqez3PDIBMGAU9eIHGFgOEqeiMi5vw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778081692; c=relaxed/simple; bh=4POrRoo1sRsS9U1jgl89A/gMYkb6/DDL8ozghhsh5xM=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=Oe4WXC2a2r2iyf5uhEPpJAEQt4vc78fC50TWoOA57aztpL+vFMOq9D9+gV+woiQqTlU+/1Iv9D2zVkYRQZqSqNtCFFythHnULw61UZ5dhyrnrRyN/7/0XmjqfKKraDFRcrr+gJ//89mPNJvvFzlv0YZlmy7TDLUAYpozEeni8AQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L1OMJgZK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L1OMJgZK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 737A5C2BCB0; Wed, 6 May 2026 15:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778081689; bh=4POrRoo1sRsS9U1jgl89A/gMYkb6/DDL8ozghhsh5xM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=L1OMJgZKybDQisblTbniU+sNh4haZY4OYruHL6oBaY5HXw1WErNbpgTPV8bublrLh obVL+OOaGPvbfuGz4eE+v/2NapW6T5xsodo0Bp6/bnMzSQtX69N1aSBd7JWb7a7vYL 3uvtO2Sh75ZHsoz9sGLDuVtZ/ivSehYrxEgUsw7+vgnjY8Kh0Sd5JFuLgQVMQlRnMw 1aqHBnVJhw/7GQDAYkvrjPzfMZVCc4ZcxXyLYPFFWzNsBMI5U7YRvpfPaBgEgHQi5A eAYQN1rk8WxSRqc84tuaCEc1mfJo8dmg7/Sm5Wx6LXQbRPsfxsw8MTg7iAYTRiEHBV GiFQHHHdtl2eA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wKeGt-00000000LRQ-15uY; Wed, 06 May 2026 15:34:47 +0000 Date: Wed, 06 May 2026 16:34:46 +0100 Message-ID: <86zf2cy2jt.wl-maz@kernel.org> From: Marc Zyngier To: Vincent Donnefort Cc: Mostafa Saleh , 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 In-Reply-To: References: <20260430103724.2151625-1-smostafa@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: vdonnefort@google.com, 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 X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 06 May 2026 16:23:26 +0100, Vincent Donnefort wrote: >=20 > On Wed, May 06, 2026 at 04:10:20PM +0100, Mostafa Saleh wrote: > > On Wed, May 6, 2026 at 4:03=E2=80=AFPM Vincent Donnefort 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 ho= st > > > > is buggy. >=20 > > > > > > I am not sure about the gain here. The host can still write values th= at will > > > make it out of sync anyway. > > > > > > The timestamp is ultimately fed and read by the host. > > > > >=20 > > 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%40googl= e.com > >=20 > > Thanks, > > Mostafa >=20 > I would then reword that to make it clear it just prevents the host trigg= ering > UB on the hypervisor. It doesn't really harden much, which is fine becaus= e that > data isn't relevant for the hypervisor. I can repaint the commit message when applying this. >=20 > Other than that: >=20 > Reviewed-by: Vincent Donnefort Thanks, M. --=20 Without deviation from the norm, progress is not possible.