[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874kcm3byd.wl-maz@kernel.org>
Date: Thu, 22 Jul 2021 11:00:26 +0100
From: Marc Zyngier <maz@...nel.org>
To: Andrew Jones <drjones@...hat.com>
Cc: linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...roid.com, Srivatsa Vaddagiri <vatsa@...eaurora.org>,
Shanker R Donthineni <sdonthineni@...dia.com>,
will@...nel.org
Subject: Re: [PATCH 00/16] KVM: arm64: MMIO guard PV services
On Wed, 21 Jul 2021 22:42:43 +0100,
Andrew Jones <drjones@...hat.com> wrote:
>
> On Thu, Jul 15, 2021 at 05:31:43PM +0100, Marc Zyngier wrote:
> > KVM/arm64 currently considers that any memory access outside of a
> > memslot is a MMIO access. This so far has served us very well, but
> > obviously relies on the guest trusting the host, and especially
> > userspace to do the right thing.
> >
> > As we keep on hacking away at pKVM, it becomes obvious that this trust
> > model is not really fit for a confidential computing environment, and
> > that the guest would require some guarantees that emulation only
> > occurs on portions of the address space that have clearly been
> > identified for this purpose.
>
> This trust model is hard for me to reason about. userspace is trusted to
> control the life cycle of the VM, to prepare the memslots for the VM,
> and [presumably] identify what MMIO ranges are valid, yet it's not
> trusted to handle invalid MMIO accesses. I'd like to learn more about
> this model and the userspace involved.
Imagine the following scenario:
On top of the normal memory described as memslots (which pKVM will
ensure that userspace cannot access), a malicious userspace describes
to the guest another memory region in a firmware table and does not
back it with a memslot.
The hypervisor cannot validate this firmware description (imagine
doing ACPI and DT parsing at EL2...), so the guest starts using this
"memory" for something, and data slowly trickles all the way to EL0.
Not what you wanted.
To ensure that this doesn't happen, we reverse the problem: userspace
(and ultimately the EL1 kernel) doesn't get involved on a translation
fault outside of a memslot *unless* the guest has explicitly asked for
that page to be handled as a MMIO. With that, we have a full
description of the IPA space contained in the S2 page tables:
- memory described via a memslot,
- directly mapped device (GICv2, for exmaple),
- MMIO exposed for emulation
and anything else is an invalid access that results in an abort.
Does this make sense to you?
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists