From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Tamas K Lengyel <tamas.lengyel@zentific.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
wei.liu2@citrix.com, Ian Campbell <ian.campbell@citrix.com>,
Steven Maresca <steve@zentific.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Jun Nakajima <jun.nakajima@intel.com>, Tim Deegan <tim@xen.org>,
Ian Jackson <ian.jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
"Dong, Eddie" <eddie.dong@intel.com>,
Andres Lagar-Cavilla <andres@lagarcavilla.org>,
Jan Beulich <jbeulich@suse.com>,
rshriram@cs.ubc.ca, Keir Fraser <keir@xen.org>,
yanghy@cn.fujitsu.com,
Razvan Cojocaru <rcojocaru@bitdefender.com>
Subject: Re: [RFC PATCH V3 05/12] xen: Introduce vm_event
Date: Mon, 02 Feb 2015 14:35:05 -0500 [thread overview]
Message-ID: <54CFD169.4000607@tycho.nsa.gov> (raw)
In-Reply-To: <CAErYnshaLd9B-3YN-0ciNcdio4ZyF7FXEzN4Kps3EgVDycWcGg@mail.gmail.com>
On 01/31/2015 08:24 AM, Tamas K Lengyel wrote:
> On Fri, Jan 30, 2015 at 6:25 PM, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> On 01/29/2015 04:46 PM, Tamas K Lengyel wrote:
>>>
>>> To make it easier to review the renaming process of mem_event -> vm_event,
>>> the process is broken into three pieces, of which this patch is the first.
>>> In this patch the vm_event subsystem is introduced and hooked into the
>>> build
>>> process, but it is not yet used anywhere.
>>>
>>> Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
>>
>>
>> [...]
>>>
>>> diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
>>> index f20e89c..d6d403a 100644
>>> --- a/xen/include/xsm/dummy.h
>>> +++ b/xen/include/xsm/dummy.h
>>> @@ -525,6 +525,18 @@ static XSM_INLINE int
>>> xsm_mem_event_op(XSM_DEFAULT_ARG struct domain *d, int op)
>>> XSM_ASSERT_ACTION(XSM_DM_PRIV);
>>> return xsm_default_action(action, current->domain, d);
>>> }
>>> +
>>> +static XSM_INLINE int xsm_vm_event_control(XSM_DEFAULT_ARG struct domain
>>> *d, int mode, int op)
>>> +{
>>> + XSM_ASSERT_ACTION(XSM_PRIV);
>>> + return xsm_default_action(action, current->domain, d);
>>> +}
>>> +
>>> +static XSM_INLINE int xsm_vm_event_op(XSM_DEFAULT_ARG struct domain *d,
>>> int op)
>>> +{
>>> + XSM_ASSERT_ACTION(XSM_DM_PRIV);
>>> + return xsm_default_action(action, current->domain, d);
>>> +}
>>> #endif
>>>
>> [...]
>>>
>>> diff --git a/xen/xsm/flask/policy/access_vectors
>>> b/xen/xsm/flask/policy/access_vectors
>>> index 1da9f63..a4241b5 100644
>>> --- a/xen/xsm/flask/policy/access_vectors
>>> +++ b/xen/xsm/flask/policy/access_vectors
>>> @@ -250,6 +250,7 @@ class hvm
>>> hvmctl
>>> # XEN_DOMCTL_set_access_required
>>> mem_event
>>> + vm_event
>>> # XEN_DOMCTL_mem_sharing_op and XENMEM_sharing_op_{share,add_physmap}
>>> with:
>>> # source = the domain making the hypercall
>>> # target = domain whose memory is being shared
>>>
>>
>> This implies that device model domains should be allowed to use the
>> operations
>> covered by xsm_vm_event_op but not those covered by xsm_vm_event_control.
>> If this is how the eventual operations are intended to be used, the FLASK
>> permissions also need to be split so that a similar distinction can be made
>> in
>> the policy.
>>
>> After looking at the later patches in this series, this appears to be a flaw
>> in
>> the existing FLASK hooks that got copied over. While it is still useful to
>> fix,
>> it may be better to make the split in a separate patch from the renames.
>> Now
>> that VM events apply to more than just HVM domains, it may be useful to move
>> the new permission(s) from class hvm to either domain2 or mmu.
>>
>> --
>> Daniel De Graaf
>> National Security Agency
>
> Moving it to domain2 would make sense to me. The namings seem to be
> pretty poor so I have a hard time understanding why xsm_vm_event_op
> and xsm_vm_event_control differ when it comes to device model domains.
> The event_op corresponds to memops for access, paging and sharing
> while event_control for the domctl that enables/disables the rings. So
> yes, I think splitting the name for these separating things would make
> sense to clarify what they represent but whether that restriction on
> device model domains was intentional I'm not sure about.
>
> Tamas
If the device model stubdom does not use (or plan to use) the memory_op
hypercall, then there is no reason to allow it to make this hypercall,
and the XSM check should be changed from XSM_DM_PRIV to XSM_PRIV. From
a quick look, this seems to be true, but I would defer to someone who
has actually used or developed this subsystem.
As far as the naming, several other hypercalls such as tmem have a
distinction between "use" and "control" that is reflected in the XSM
policy. From a quick look at how the hypercalls work, the domctl seems
to be a toolstack-only feature that is set when building a domain, while
the mem_event_op hypercall is used by a helper process.
I think it might be possible to move the helper process to a stub domain
when creating a very disaggregated system. In that case, a distinct
permission for its hypercalls would be useful to let the stub domain
perform sharing operations without being able to turn sharing on and
off. Otherwise the current single permission (moved to domain2) should
be sufficient.
--
Daniel De Graaf
National Security Agency
next prev parent reply other threads:[~2015-02-02 19:35 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 21:46 [RFC PATCH V3 00/12] xen: Clean-up of mem_event subsystem Tamas K Lengyel
2015-01-29 21:46 ` [RFC PATCH V3 01/12] xen/mem_event: Cleanup of mem_event structures Tamas K Lengyel
2015-02-02 17:19 ` Ian Campbell
2015-02-03 9:17 ` Jan Beulich
2015-02-05 12:12 ` Tamas K Lengyel
2015-02-05 12:13 ` Tamas K Lengyel
2015-02-03 15:32 ` Jan Beulich
2015-01-29 21:46 ` [RFC PATCH V3 02/12] xen/mem_event: Rename the mem_event ring from 'access' to 'monitor' Tamas K Lengyel
2015-02-02 17:22 ` Ian Campbell
2015-02-03 15:37 ` Jan Beulich
2015-02-05 14:24 ` Tamas K Lengyel
2015-01-29 21:46 ` [RFC PATCH V3 03/12] xen/mem_paging: Convert mem_event_op to mem_paging_op Tamas K Lengyel
2015-02-02 17:23 ` Ian Campbell
2015-02-03 15:41 ` Jan Beulich
2015-01-29 21:46 ` [RFC PATCH V3 04/12] xen/mem_access: Merge mem_event sanity check into mem_access check Tamas K Lengyel
2015-01-29 21:46 ` [RFC PATCH V3 05/12] xen: Introduce vm_event Tamas K Lengyel
2015-01-30 17:25 ` Daniel De Graaf
2015-01-31 13:24 ` Tamas K Lengyel
2015-02-02 19:35 ` Daniel De Graaf [this message]
2015-02-06 14:04 ` Tamas K Lengyel
2015-02-02 17:27 ` Ian Campbell
2015-02-03 15:54 ` Jan Beulich
2015-02-06 13:54 ` Tamas K Lengyel
2015-02-06 13:58 ` Andrew Cooper
2015-02-06 14:01 ` Tamas K Lengyel
2015-01-29 21:46 ` [RFC PATCH V3 06/12] xen: migrate mem_event to vm_event Tamas K Lengyel
2015-02-02 17:27 ` Ian Campbell
2015-02-03 16:22 ` Jan Beulich
2015-01-29 21:46 ` [RFC PATCH V3 07/12] xen: Remove mem_event Tamas K Lengyel
2015-01-30 17:25 ` Daniel De Graaf
2015-02-02 17:29 ` Ian Campbell
2015-02-03 16:26 ` Jan Beulich
2015-02-06 12:54 ` Tamas K Lengyel
2015-02-06 14:18 ` Jan Beulich
2015-02-06 16:13 ` Tamas K Lengyel
2015-01-29 21:46 ` [RFC PATCH V3 08/12] tools/tests: Clean-up tools/tests/xen-access Tamas K Lengyel
2015-02-02 17:30 ` Ian Campbell
2015-01-29 21:46 ` [RFC PATCH V3 09/12] x86/hvm: factor out and rename vm_event related functions into separate file Tamas K Lengyel
2015-02-04 5:54 ` Tian, Kevin
2015-02-04 9:14 ` Jan Beulich
2015-01-29 21:46 ` [RFC PATCH V3 10/12] xen: Introduce monitor_op domctl Tamas K Lengyel
2015-01-30 7:58 ` Razvan Cojocaru
2015-01-30 10:38 ` Tamas K Lengyel
2015-01-30 11:07 ` Razvan Cojocaru
2015-01-30 11:15 ` Tamas K Lengyel
2015-01-30 11:24 ` Tamas K Lengyel
2015-01-30 11:33 ` Razvan Cojocaru
2015-01-30 11:45 ` Tamas K Lengyel
2015-01-30 12:24 ` Razvan Cojocaru
2015-01-30 12:36 ` Tamas K Lengyel
2015-02-02 17:32 ` Ian Campbell
2015-02-04 5:57 ` Tian, Kevin
2015-02-04 9:34 ` Jan Beulich
2015-02-05 14:15 ` Tamas K Lengyel
2015-02-09 18:45 ` Tamas K Lengyel
2015-01-29 21:46 ` [RFC PATCH V3 11/12] xen/vm_event: Decouple vm_event and mem_access Tamas K Lengyel
2015-02-04 9:47 ` Jan Beulich
2015-02-06 13:10 ` Tamas K Lengyel
2015-02-06 14:20 ` Jan Beulich
2015-02-06 16:12 ` Tamas K Lengyel
2015-01-29 21:46 ` [RFC PATCH V3 12/12] xen/vm_event: Check for VM_EVENT_FLAG_DUMMY only in Debug builds Tamas K Lengyel
2015-02-04 5:59 ` Tian, Kevin
2015-02-06 13:20 ` Tamas K Lengyel
2015-02-04 9:49 ` Jan Beulich
2015-02-06 13:22 ` Tamas K Lengyel
2015-02-02 17:33 ` [RFC PATCH V3 00/12] xen: Clean-up of mem_event subsystem Ian Campbell
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=54CFD169.4000607@tycho.nsa.gov \
--to=dgdegra@tycho.nsa.gov \
--cc=andres@lagarcavilla.org \
--cc=eddie.dong@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=rcojocaru@bitdefender.com \
--cc=rshriram@cs.ubc.ca \
--cc=stefano.stabellini@eu.citrix.com \
--cc=steve@zentific.com \
--cc=tamas.lengyel@zentific.com \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=yanghy@cn.fujitsu.com \
/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.