lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85jz49x31p.fsf@amd.com>
Date: Tue, 15 Jul 2025 08:37:38 +0000
From: Nikunj A Dadhania <nikunj@....com>
To: Sean Christopherson <seanjc@...gle.com>, Borislav Petkov <bp@...en8.de>
CC: Tom Lendacky <thomas.lendacky@....com>, <linux-kernel@...r.kernel.org>,
	<x86@...nel.org>, <tglx@...utronix.de>, <mingo@...hat.com>,
	<dave.hansen@...ux.intel.com>, <santosh.shukla@....com>
Subject: Re: [PATCH] x86/sev: Improve handling of writes to intercepted
 GUEST_TSC_FREQ

Sean Christopherson <seanjc@...gle.com> writes:

> On Mon, Jul 14, 2025, Borislav Petkov wrote:
>> On Mon, Jul 14, 2025 at 08:17:13AM -0700, Sean Christopherson wrote:
>> 
>> The original text in the patch:
>> 
>> "Only terminate the guest when reading from intercepted GUEST_TSC_FREQ MSR
>> with Secure TSC enabled, as this indicates an unexpected hypervisor
>> configuration."
>> 
>> doesn't make too much sense to me.
>> 
>> Maybe you need to explain things in detail as virt and I don't understand each
>> other too much yet.

How about the below changelog:

  Currently, when a Secure TSC enabled SNP guest attempts to write to
  the intercepted GUEST_TSC_FREQ MSR (a read-only MSR), the guest kernel
  #VC handler terminates the SNP guest by returning ES_VMM_ERROR. This
  response incorrectly implies a VMM configuration error, when in fact
  it's a valid VMM configuration to intercept writes to read-only MSRs,
  unless explicitly documented.

  Modify the intercepted GUEST_TSC_FREQ MSR #VC handler to ignore writes
  instead of terminating the guest. Since GUEST_TSC_FREQ is a guest-only
  MSR, ignoring writes directly (rather than forwarding to the VMM and
  handling the resulting #GP) eliminates a round trip to the VMM. Add a
  WARN_ONCE to log the incident, as well-behaved guest kernels should
  never attempt to write to this read-only MSR.

  However, continue to terminate the guest(via ES_VMM_ERROR) when
  reading from intercepted GUEST_TSC_FREQ MSR with Secure TSC enabled,
  as intercepted reads indicate an improper VMM configuration for Secure
  TSC enabled SNP guests.

Regards,
Nikunj

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ