Re: [PATCH] KVM: SEV: Return INVALID_INPUT on SNP req/resp buffer access failure
From: Jacky Li
Date: Thu Sep 10 2026 - 21:01:34 EST
On Thu, Sep 10, 2026, Sean Christopherson wrote:
> When stating what a patch does (or doesn't) do, phrase everything as commands.
> Passively describing the patch, as done above, is problematic as it's not clear
> if the changelog is talking about what the patch itself is (not) doing, or if
> it's talking about the side effects of the changes. Whereas this:
>
> Don't try to validate guest-provide ahead of time, as such checks are prone
> to TOCTOU races, e.g. with Page State Changes, memslot updates, etc.
>
> is more obviously talking about the patch.
Will do, thanks! I'll use your wording in v2, with s/guest-provide/
guest-provided buffers/ and reflowed to fit two lines:
Don't try to validate guest-provided buffers ahead of time, as such checks
are prone to TOCTOU races (e.g. with Page State Changes, memslot updates).
> I don't love that userspace VMM goofs will bleed into the guest, but on the other
> hand, KVM already uses this pattern for Hyper-V hypercalls (and worse patterns
> for KVM-defined PV features), and practically speaking this is better behavior
> than returning -EIO. So I'm good with this.
Agreed, it's not ideal, but KVM can't distinguish a bogus guest GPA from a
VMM goof for now, and killing the VM is worse for the former.