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: <616212d3261c3c3213bced1fdb6b2f0982c55928.camel@intel.com>
Date: Mon, 14 Apr 2025 12:15:23 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "seanjc@...gle.com" <seanjc@...gle.com>, "Gao, Chao" <chao.gao@...el.com>
CC: "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
	"x86@...nel.org" <x86@...nel.org>, "bp@...en8.de" <bp@...en8.de>,
	"mingo@...hat.com" <mingo@...hat.com>, "tglx@...utronix.de"
	<tglx@...utronix.de>, "hpa@...or.com" <hpa@...or.com>, "kvm@...r.kernel.org"
	<kvm@...r.kernel.org>, "pbonzini@...hat.com" <pbonzini@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: VMX: Flush shadow VMCS on emergency reboot

On Fri, 2025-04-11 at 09:57 -0700, Sean Christopherson wrote:
> > > 
> > > On a very related topic, doesn't SPR+ now flush the VMCS caches on VMXOFF?  If
> > 
> > Actually this behavior is not publicly documented.
> 
> Well shoot.  That should probably be remedied.  Even if the behavior is guaranteed
> only on CPUs that support SEAM, _that_ detail should be documented.  I'm not
> holding my breath on Intel allowing third party code in SEAM, but the mode _is_
> documented in the SDM, and so IMO, the SDM should also document how things like
> clearing the VMCS cache are supposed to work when there are VMCSes that "untrusted"
> software may not be able to access.
> 
> > > that's going to be the architectural behavior going forward, will that behavior
> > > be enumerated to software?  Regardless of whether there's software enumeration,
> > > I would like to have the emergency disable path depend on that behavior.  In part
> > > to gain confidence that SEAM VMCSes won't screw over kdump, but also in light of
> > > this bug.
> > 
> > I don't understand how we can gain confidence that SEAM VMCSes won't screw
> > over kdump.
> 
> If KVM relies on VMXOFF to purge the VMCS cache, then it gives a measure of
> confidence that running TDX VMs won't leave behind SEAM VMCSes in the cache.  KVM
> can't easily clear SEAM VMCSs, but IIRC, the memory can be "forcefully" reclaimed
> by paving over it with MOVDIR64B, at which point having VMCS cache entries for
> the memory would be problematic.

I am not sure why we need to use MOVDIR64B to clear SEAM VMCSes in kdump? 
Regardless of whether we do that or not, IIUC there is no harm even we still
have SEAM VMCS cache entries in kdump:

They are associated with TDX private KeyID(s).  Sudden write back of them
doesn't matter because when reading them from /proc/vmcore they are garbage
anyway.  And IIUC no machine check (due to TD bit mismatch) will happen either.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ