All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: "Xu, Dongxiao" <dongxiao.xu@intel.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "George.Dunlap@eu.citrix.com" <George.Dunlap@eu.citrix.com>,
	"Ian.Jackson@eu.citrix.com" <Ian.Jackson@eu.citrix.com>,
	"keir@xen.org" <keir@xen.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v12 1/9] x86: add generic resource (e.g. MSR) access hypercall
Date: Wed, 09 Jul 2014 10:17:33 -0400	[thread overview]
Message-ID: <53BD4EFD.1050901@tycho.nsa.gov> (raw)
In-Reply-To: <40776A41FC278F40B59438AD47D147A911A58B07@SHSMSX104.ccr.corp.intel.com>

On 07/08/2014 10:06 PM, Xu, Dongxiao wrote:
>> -----Original Message-----
>> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
>> Sent: Tuesday, July 08, 2014 5:08 PM
>> To: Xu, Dongxiao; Jan Beulich; xen-devel@lists.xen.org
>> Cc: keir@xen.org; Ian.Campbell@citrix.com; George.Dunlap@eu.citrix.com;
>> stefano.stabellini@eu.citrix.com; Ian.Jackson@eu.citrix.com;
>> dgdegra@tycho.nsa.gov
>> Subject: Re: [Xen-devel] [PATCH v12 1/9] x86: add generic resource (e.g. MSR)
>> access hypercall
>>
>> On 08/07/14 08:06, Xu, Dongxiao wrote:
>>>> -----Original Message-----
>>>> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
>>>> Sent: Friday, July 04, 2014 6:53 PM
>>>> To: Jan Beulich; Xu, Dongxiao; xen-devel@lists.xen.org
>>>> Cc: Ian.Campbell@citrix.com; George.Dunlap@eu.citrix.com;
>>>> Ian.Jackson@eu.citrix.com; stefano.stabellini@eu.citrix.com;
>>>> konrad.wilk@oracle.com; dgdegra@tycho.nsa.gov; keir@xen.org
>>>> Subject: Re: [PATCH v12 1/9] x86: add generic resource (e.g. MSR) access
>>>> hypercall
>>>>
>>>> On 04/07/14 11:30, Jan Beulich wrote:
>>>>>>>> On 04.07.14 at 11:40, <andrew.cooper3@citrix.com> wrote:
>>>>>> On 04/07/14 09:34, Dongxiao Xu wrote:
>>>>>>> Add a generic resource access hypercall for tool stack or other
>>>>>>> components, e.g., accessing MSR, port I/O, etc.
>>>>>>>
>>>>>>> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
>>>>>> This still permits a user of the hypercalls to play with EFER or
>>>>>> SYSENTER_EIP, which obviously is a very bad thing.
>>>>>>
>>>>>> There needs to be a whitelist of permitted MSRs which can be accessed.
>>>>> Hmm, I'm not sure. One particular purpose I see here is to allow the
>>>>> tool stack (or Dom0) access to MSRs Xen may not know about (yet).
>>>>> Furthermore, this being a platform op, only the hardware domain
>>>>> should ever have access, and it certainly ought to know what it's
>>>>> doing. So the sum of these two considerations is: If at all, we may
>>>>> want a black list here.
>>>>>
>>>>> Jan
>>>>>
>>>> I don't think it is safe for the toolstack to ever be playing with MSRs
>>>> which Xen is completely unaware of.  There is no guarentee whatsoever
>>>> that a new MSR which Xen is unaware of doesn't have security
>>>> implications if the toolstack were to play with it.
>>>>
>>>> Adding entries to a whitelist is easy and could be considered a
>>>> maintenance activity similar to keeping the model/stepping information
>>>> up-to-date.
>>> This resource access mechanism is useful according to some conversation with
>> IPDC customers. Per their description, once the machine and VMs are online,
>> they will not be turned off. Sometimes administrators may need to dynamically
>> modify some resource values to fix/workaround certain issues, and our patch
>> may serve this purpose.
>>>
>>> Adding the white/black list will bring certain constraints for the above use case.
>> Also considering that the tool stack resides in dom0, I think it is not so dangerous.
>>
>> The whole purpose of XSM is to split the toolstack up so it isn't all in
>> dom0.
>
> We limited this resource operation in domain 0 through xsm policies.

In this case, I expect a security-conscious administrator will need to
block access to this hypercall completely.  XSM does make this possible,
but that loses all the benefits of adding this feature.

>>
>> Extending a whitelist is trivial, and requires a positive action on
>> behalf of someone to decide that the added MSR *is* safe.  Anything else
>> is a security bug waiting to happen.
>
> Considering that today's QEMU could even map all guest's memory and it is also resides in dom0.
> Not sure how dangerous this resource operation is if we didn't add such whitelist or blacklist...
>
> Thanks,
> Dongxiao

The toolstack domain can only map all guest memory for all guests as
long as the toolstack is not disaggregated.  Even without diaggregation,
it is possible to set up domains whose memory dom0 cannot map: dom0
merely needs to be trusted to set the XSM label after domain creation,
which can be done from an initrd or before accepting logins/commands.

The resource operation has already been identified to be fully
dangerous: modifying SYSENTER_EIP allows a userspace program in domain 0
to run code in hypervisor context.  This bypasses any security features
that the Linux kernel in dom0 may be trying to provide in addition to
those that Xen provides.

-- 
Daniel De Graaf
National Security Agency

  reply	other threads:[~2014-07-09 14:17 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04  8:34 [PATCH v12 0/9] enable Cache QoS Monitoring (CQM) feature Dongxiao Xu
2014-07-04  8:34 ` [PATCH v12 1/9] x86: add generic resource (e.g. MSR) access hypercall Dongxiao Xu
2014-07-04  9:40   ` Andrew Cooper
2014-07-04 10:30     ` Jan Beulich
2014-07-04 10:52       ` Andrew Cooper
2014-07-08  7:06         ` Xu, Dongxiao
2014-07-08  9:07           ` Andrew Cooper
2014-07-08  9:30             ` Jürgen Groß
2014-07-09  2:06             ` Xu, Dongxiao
2014-07-09 14:17               ` Daniel De Graaf [this message]
2014-07-08  8:57         ` George Dunlap
2014-07-08  9:20           ` Andrew Cooper
2014-07-04 10:44   ` Jan Beulich
2014-07-11  4:29     ` Xu, Dongxiao
2014-07-11  9:24       ` Andrew Cooper
2014-07-04  8:34 ` [PATCH v12 2/9] xsm: add resource operation related xsm policy Dongxiao Xu
2014-07-08 21:22   ` Daniel De Graaf
2014-07-09  5:28     ` Xu, Dongxiao
2014-07-09 14:17       ` Daniel De Graaf
2014-07-04  8:34 ` [PATCH v12 3/9] tools: provide interface for generic MSR access Dongxiao Xu
2014-07-04 11:42   ` Jan Beulich
2014-07-09 16:58     ` Ian Campbell
2014-07-23  7:48       ` Jan Beulich
2014-07-24  6:31         ` Xu, Dongxiao
2014-07-24  6:56           ` Jan Beulich
2014-07-24  6:36         ` Xu, Dongxiao
2014-07-09 17:01   ` Ian Campbell
2014-07-04  8:34 ` [PATCH v12 4/9] x86: detect and initialize Platform QoS Monitoring feature Dongxiao Xu
2014-07-04 11:56   ` Jan Beulich
2014-07-15  6:18     ` Xu, Dongxiao
2014-07-04  8:34 ` [PATCH v12 5/9] x86: dynamically attach/detach QoS monitoring service for a guest Dongxiao Xu
2014-07-04 12:06   ` Jan Beulich
2014-07-15  5:31     ` Xu, Dongxiao
2014-07-23  7:53       ` Jan Beulich
2014-07-04  8:34 ` [PATCH v12 6/9] x86: collect global QoS monitoring information Dongxiao Xu
2014-07-04 12:14   ` Jan Beulich
2014-08-01  8:26     ` Xu, Dongxiao
2014-08-01  9:19       ` Jan Beulich
2014-07-04  8:34 ` [PATCH v12 7/9] x86: enable QoS monitoring for each domain RMID Dongxiao Xu
2014-07-04 12:15   ` Jan Beulich
2014-07-04  8:34 ` [PATCH v12 8/9] xsm: add platform QoS related xsm policies Dongxiao Xu
2014-07-08 21:22   ` Daniel De Graaf
2014-07-04  8:34 ` [PATCH v12 9/9] tools: CMDs and APIs for Platform QoS Monitoring Dongxiao Xu
2014-07-10 15:50   ` Ian Campbell
2014-07-04 10:26 ` [PATCH v12 0/9] enable Cache QoS Monitoring (CQM) feature Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2014-07-15  2:23 [PATCH v12 1/9] x86: add generic resource (e.g. MSR) access hypercall Xu, Dongxiao
2014-07-15 10:00 ` Andrew Cooper
2014-07-23  7:45   ` Jan Beulich
2014-07-23  9:09     ` Andrew Cooper
2014-07-28 10:01       ` Jan Beulich

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=53BD4EFD.1050901@tycho.nsa.gov \
    --to=dgdegra@tycho.nsa.gov \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dongxiao.xu@intel.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.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 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.