From: Sean Christopherson <sean.j.christopherson@intel.com>
To: kvm@vger.kernel.org
Subject: Re: Interaction between host-side mprotect() and KVM MMU
Date: Fri, 24 May 2019 12:26:59 -0700 [thread overview]
Message-ID: <20190524192659.GE365@linux.intel.com> (raw)
In-Reply-To: <20190523092703.ddze6zcfsm2cj6kc@nodbug.lucina.net>
On Thu, May 23, 2019 at 11:27:03AM +0200, Martin Lucina wrote:
> On Tuesday, 21.05.2019 at 07:02, Sean Christopherson wrote:
> > Not without modifying KVM and the kernel (if you want to do it through
> > mprotect()).
>
> Hooking up the full EPT protection bits available to KVM via mprotect()
> would be the best solution for us, and could also give us the ability to
> have execute-only pages on x86, which is a nice defence against ROP attacks
> in the guest. However, I can see now that this is not a trivial
> undertaking, especially across the various MMU models (tdp, softmmu) and
> architectures dealt with by the core KVM code.
Belated thought on this...
Propagating PROT_EXEC from the host's VMAs to the EPT tables would require
having *guest* memory mapped with PROT_EXEC in the host. This is a
non-starter for traditional virtualization as it would all but require the
hypervisor to have RWX pages.
For the Solo5 case, since the guest is untrusted, mapping its code as
executable in the host seems almost as bad from a security perspective.
So yeah, mprotect() might be convenient, but adding a KVM_MEM_NOEXEC
flag to KVM_SET_USER_MEMORY_REGION would be more secure (and probably
easier to implement in KVM).
next prev parent reply other threads:[~2019-05-24 19:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 7:24 Interaction between host-side mprotect() and KVM MMU Martin Lucina
2019-05-21 8:14 ` Martin Lucina
2019-05-21 14:02 ` Sean Christopherson
2019-05-23 9:27 ` Martin Lucina
2019-05-23 14:53 ` Sean Christopherson
2019-05-24 12:03 ` Martin Lucina
2019-05-24 19:26 ` Sean Christopherson [this message]
2019-06-06 11:52 ` Martin Lucina
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=20190524192659.GE365@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=kvm@vger.kernel.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.