[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e396697-afc8-51cc-07de-882499532b68@amd.com>
Date: Tue, 15 Aug 2023 10:44:39 -0500
From: Tom Lendacky <thomas.lendacky@....com>
To: Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: pgonda@...gle.com, seanjc@...gle.com, theflow@...gle.com,
vkuznets@...hat.com, stable@...r.kernel.org
Subject: Re: [PATCH 1/3] KVM: SEV: snapshot the GHCB before accessing it
On 8/4/23 12:33, Paolo Bonzini wrote:
> Validation of the GHCB is susceptible to time-of-check/time-of-use vulnerabilities.
> To avoid them, we would like to always snapshot the fields that are read in
> sev_es_validate_vmgexit(), and not use the GHCB anymore after it returns.
>
> This means:
>
> - invoking sev_es_sync_from_ghcb() before any GHCB access, including before
> sev_es_validate_vmgexit()
>
> - snapshotting all fields including the valid bitmap and the sw_scratch field,
> which are currently not caching anywhere.
>
> The valid bitmap is the first thing to be copied out of the GHCB; then,
> further accesses will use the copy in svm->sev_es.
>
> Fixes: 291bd20d5d88 ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT")
> Cc: stable@...r.kernel.org
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@....com>
> ---
> arch/x86/kvm/svm/sev.c | 69 +++++++++++++++++++++---------------------
> arch/x86/kvm/svm/svm.h | 26 ++++++++++++++++
> 2 files changed, 61 insertions(+), 34 deletions(-)
>
Powered by blists - more mailing lists