From: Paul Mackerras <paulus@ozlabs.org>
To: Laurent Dufour <ldufour@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 0/2] Fix SVM hang at startup
Date: Tue, 24 Mar 2020 02:54:29 +0000 [thread overview]
Message-ID: <20200324025429.GD5604@blackberry> (raw)
In-Reply-To: <20200320102643.15516-1-ldufour@linux.ibm.com>
On Fri, Mar 20, 2020 at 11:26:41AM +0100, Laurent Dufour wrote:
> This series is fixing a SVM hang occurring when starting a SVM requiring
> more secure memory than available. The hang happens in the SVM when calling
> UV_ESM.
>
> The following is happening:
>
> 1. SVM calls UV_ESM
> 2. Ultravisor (UV) calls H_SVM_INIT_START
> 3. Hypervisor (HV) calls UV_REGISTER_MEM_SLOT
> 4. UV returns error because there is not enough free secure memory
> 5. HV enter the error path in kvmppc_h_svm_init_start()
> 6. In the return path, since kvm->arch.secure_guest is not yet set hrfid is
> called
> 7. As the HV doesn't know the SVM calling context hrfid is jumping to
> unknown address in the SVM leading to various expections.
>
> This series fixes the setting of kvm->arch.secure_guest in
> kvmppc_h_svm_init_start() to ensure that UV_RETURN is called on the return
> path to get back to the UV.
>
> In addition to ensure that a malicious VM will not call UV reserved Hcall,
> a check of the Secure bit in the calling MSR is addded to reject such a
> call.
>
> It is assumed that the UV will filtered out such Hcalls made by a malicious
> SVM.
>
> Laurent Dufour (2):
> KVM: PPC: Book3S HV: check caller of H_SVM_* Hcalls
> KVM: PPC: Book3S HV: H_SVM_INIT_START must call UV_RETURN
>
> arch/powerpc/kvm/book3s_hv.c | 32 ++++++++++++++++++++----------
> arch/powerpc/kvm/book3s_hv_uvmem.c | 3 ++-
> 2 files changed, 23 insertions(+), 12 deletions(-)
Thanks, series applied to my kvm-ppc-next branch.
Paul.
WARNING: multiple messages have this Message-ID (diff)
From: Paul Mackerras <paulus@ozlabs.org>
To: Laurent Dufour <ldufour@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 0/2] Fix SVM hang at startup
Date: Tue, 24 Mar 2020 13:54:29 +1100 [thread overview]
Message-ID: <20200324025429.GD5604@blackberry> (raw)
In-Reply-To: <20200320102643.15516-1-ldufour@linux.ibm.com>
On Fri, Mar 20, 2020 at 11:26:41AM +0100, Laurent Dufour wrote:
> This series is fixing a SVM hang occurring when starting a SVM requiring
> more secure memory than available. The hang happens in the SVM when calling
> UV_ESM.
>
> The following is happening:
>
> 1. SVM calls UV_ESM
> 2. Ultravisor (UV) calls H_SVM_INIT_START
> 3. Hypervisor (HV) calls UV_REGISTER_MEM_SLOT
> 4. UV returns error because there is not enough free secure memory
> 5. HV enter the error path in kvmppc_h_svm_init_start()
> 6. In the return path, since kvm->arch.secure_guest is not yet set hrfid is
> called
> 7. As the HV doesn't know the SVM calling context hrfid is jumping to
> unknown address in the SVM leading to various expections.
>
> This series fixes the setting of kvm->arch.secure_guest in
> kvmppc_h_svm_init_start() to ensure that UV_RETURN is called on the return
> path to get back to the UV.
>
> In addition to ensure that a malicious VM will not call UV reserved Hcall,
> a check of the Secure bit in the calling MSR is addded to reject such a
> call.
>
> It is assumed that the UV will filtered out such Hcalls made by a malicious
> SVM.
>
> Laurent Dufour (2):
> KVM: PPC: Book3S HV: check caller of H_SVM_* Hcalls
> KVM: PPC: Book3S HV: H_SVM_INIT_START must call UV_RETURN
>
> arch/powerpc/kvm/book3s_hv.c | 32 ++++++++++++++++++++----------
> arch/powerpc/kvm/book3s_hv_uvmem.c | 3 ++-
> 2 files changed, 23 insertions(+), 12 deletions(-)
Thanks, series applied to my kvm-ppc-next branch.
Paul.
next prev parent reply other threads:[~2020-03-24 2:54 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 10:26 [PATCH 0/2] Fix SVM hang at startup Laurent Dufour
2020-03-20 10:26 ` Laurent Dufour
2020-03-20 10:26 ` [PATCH 1/2] KVM: PPC: Book3S HV: check caller of H_SVM_* Hcalls Laurent Dufour
2020-03-20 10:26 ` Laurent Dufour
2020-03-20 10:26 ` Laurent Dufour
2020-03-20 12:22 ` Greg Kurz
2020-03-20 12:22 ` Greg Kurz
2020-03-20 12:22 ` Greg Kurz
2020-03-20 14:43 ` Laurent Dufour
2020-03-20 14:43 ` Laurent Dufour
2020-03-20 14:43 ` Laurent Dufour
2020-03-23 23:43 ` Paul Mackerras
2020-03-23 23:43 ` Paul Mackerras
2020-03-23 23:43 ` Paul Mackerras
2020-03-24 12:00 ` Greg Kurz
2020-03-24 12:00 ` Greg Kurz
2020-03-24 12:00 ` Greg Kurz
2020-03-24 13:13 ` Laurent Dufour
2020-03-24 13:13 ` Laurent Dufour
2020-03-24 13:13 ` Laurent Dufour
2020-03-21 0:40 ` Ram Pai
2020-03-21 0:40 ` Ram Pai
2020-03-20 10:26 ` [PATCH 2/2] KVM: PPC: Book3S HV: H_SVM_INIT_START must call UV_RETURN Laurent Dufour
2020-03-20 10:26 ` Laurent Dufour
2020-03-20 10:26 ` Laurent Dufour
2020-03-20 11:24 ` Bharata B Rao
2020-03-20 11:36 ` Bharata B Rao
2020-03-20 11:24 ` Bharata B Rao
2020-03-20 14:36 ` Laurent Dufour
2020-03-20 14:36 ` Laurent Dufour
2020-03-20 14:36 ` Laurent Dufour
2020-03-23 4:21 ` Bharata B Rao
2020-03-23 4:33 ` Bharata B Rao
2020-03-23 4:21 ` Bharata B Rao
2020-03-21 0:47 ` Ram Pai
2020-03-21 0:47 ` Ram Pai
2020-03-21 0:47 ` Ram Pai
2020-03-23 14:09 ` Fabiano Rosas
2020-03-23 14:09 ` Fabiano Rosas
2020-03-23 14:09 ` Fabiano Rosas
2020-03-24 2:54 ` Paul Mackerras [this message]
2020-03-24 2:54 ` [PATCH 0/2] Fix SVM hang at startup Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200324025429.GD5604@blackberry \
--to=paulus@ozlabs.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=ldufour@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.