From: Tamas K Lengyel <tamas@tklengyel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Petre Pircalabu <ppircalabu@bitdefender.com>,
tim@xen.org, Stefano Stabellini <sstabellini@kernel.org>,
wei.liu2@citrix.com, Razvan Cojocaru <rcojocaru@bitdefender.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH v8] x86/altp2m: support for setting restrictions for an array of pages
Date: Mon, 11 Dec 2017 09:00:34 -0700 [thread overview]
Message-ID: <CABfawhnv8X_bKhjb3f8XTeDP7KfAqArcjJTWaQb+7ZfXV7L1PQ@mail.gmail.com> (raw)
In-Reply-To: <5A2EACAF0200007800196720@prv-mh.provo.novell.com>
On Mon, Dec 11, 2017 at 8:05 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 11.12.17 at 15:51, <george.dunlap@citrix.com> wrote:
>> On 12/11/2017 02:46 PM, Razvan Cojocaru wrote:
>>> On 12/11/2017 03:36 PM, Jan Beulich wrote:
>>>>>>> On 11.12.17 at 13:50, <george.dunlap@citrix.com> wrote:
>>>>> On 12/11/2017 12:12 PM, Jan Beulich wrote:
>>>>>>>>> On 11.12.17 at 12:06, <andrew.cooper3@citrix.com> wrote:
>>>>>>> My suggestion was that we don't break usecases. The Intel usecase
>>>>>>> specifically is for an in-guest entity to have full control of all
>>>>>>> altp2m functionality, and this is fine (security wise) when permitted to
>>>>>>> do so by the toolstack.
>>>>>>
>>>>>> IOW you mean that such guests would be considered "trusted", i.e.
>>>>>> whatever bad they can do is by definition not a security concern.
>>>>>
>>>>> I'm not sure what you mean by "trusted". If implemented correctly,
>>>>> altp2m and mem_access shouldn't give the guest any more permissions than
>>>>> it has already. The main risk would be if there were bugs in the
>>>>> functionality that allowed security issues.
>>>>
>>>> Hmm, maybe I'm mis-reading the code, but
>>>> mem_access.c:set_mem_access() looks to be using the requested
>>>> access rights verbatim, i.e. without applying tool stack imposed
>>>> restrictions (hypervisor ones look to be honored by deriving
>>>> base permissions from the p2m type first).
>>>
>>> Quite likely I'm not grasping the full meaning of your objection,
>>> however the added code is merely another interface to already existing
>>> core code - so while admittedly there's room for improvement for the EPT
>>> code below it, this patch really only extends the scope of altp2m's
>>> existing version of set_mem_access() (which currently works on a single
>>> page). In that, it at least doesn't seem to make things worse (it's
>>> really just an optimization - whatever badness this code can cause with
>>> a single call, can already be achieved exactly with a sequence of
>>> xc_altp2m_set_mem_access() calls).
>>
>> I think Jan was saying that he would ideally like to remove *all* guest
>> access to altp2m functionality, even what's currently there. The more
>> extra features we make available to guests, the harder it will be in the
>> future to argue to remove it all.
>
> With one slight correction: all _uncontrolled_ access is what I'd like
> to see removed. Right now this could arguably indeed mean all
> access, as it is all uncontrolled (afaict).
>
But it is controlled. Unless you specifically allow the guest access
to the interface (ie altp2m=1 in the xl config) the guest can't do
anything with it. And if you do that, it is likely because you have an
in-guest agent that works in tandem with an out-of-guest agent
coordinating what to protect and how. You use the in-guest agent for
performance-sensitive monitoring while you can use the out-of-guest
agent to protect the in-guest agent. Of course, this is not a
requirement but what I *think* the setup was that the interface was
designed for as there is specific ability to decide which page
permission violation goes to the guest (with #VE) and which goes to
the toolstack. Plus even if the interface is enabled, it is only
available to the guest kernel. If it's a malicious guest kernel the
worst it should be able to do is crash itself (for example by
allocating a ton of altp2m tables and running out of shadow memory).
But I don't think you need the altp2m interface for a guest kernel to
crash itself.
Tamas
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2017-12-11 16:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 10:19 [PATCH v8] x86/altp2m: support for setting restrictions for an array of pages Petre Pircalabu
2017-11-20 9:35 ` Petre Ovidiu PIRCALABU
2017-11-20 11:39 ` Jan Beulich
2017-12-08 12:18 ` Jan Beulich
2017-12-08 12:42 ` Razvan Cojocaru
2017-12-08 16:56 ` Tamas K Lengyel
2017-12-11 9:14 ` Jan Beulich
2017-12-11 11:06 ` Andrew Cooper
2017-12-11 12:12 ` Jan Beulich
2017-12-11 12:50 ` George Dunlap
2017-12-11 13:36 ` Jan Beulich
2017-12-11 14:46 ` Razvan Cojocaru
2017-12-11 14:51 ` George Dunlap
2017-12-11 14:55 ` George Dunlap
2017-12-11 15:05 ` Jan Beulich
2017-12-11 15:54 ` George Dunlap
2017-12-11 15:58 ` Razvan Cojocaru
2017-12-11 16:24 ` Jan Beulich
2017-12-11 16:00 ` Tamas K Lengyel [this message]
2017-12-11 16:07 ` Razvan Cojocaru
2017-12-11 15:03 ` Jan Beulich
2017-12-11 14:50 ` George Dunlap
2017-12-11 14:58 ` Jan Beulich
2017-12-11 15:38 ` George Dunlap
2017-12-11 16:18 ` George Dunlap
2017-12-11 16:22 ` George Dunlap
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=CABfawhnv8X_bKhjb3f8XTeDP7KfAqArcjJTWaQb+7ZfXV7L1PQ@mail.gmail.com \
--to=tamas@tklengyel.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=ppircalabu@bitdefender.com \
--cc=rcojocaru@bitdefender.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).