All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Julien Grall <julien.grall@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Steve Capper <Steve.Capper@arm.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Xen Devel <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	Bhupinder Thakur <bhupinder.thakur@linaro.org>,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: Xen ARM - Exposing a PL011 to the guest
Date: Tue, 3 Jan 2017 11:38:47 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1701031138050.17742@sstabellini-ThinkPad-X260> (raw)
In-Reply-To: <b58fc8c9-fc04-389f-93de-f7105a437580@arm.com>

On Wed, 28 Dec 2016, Julien Grall wrote:
> Hi Stefano,
> 
> On 21/12/16 22:12, Stefano Stabellini wrote:
> > On Wed, 21 Dec 2016, Julien Grall wrote:
> > > On 20/12/2016 20:53, Stefano Stabellini wrote:
> > > > On Tue, 20 Dec 2016, Julien Grall wrote:
> > > > > On 19/12/2016 21:24, Stefano Stabellini wrote:
> > > > > > On Mon, 19 Dec 2016, Christoffer Dall wrote:
> > > > > > > On Fri, Dec 16, 2016 at 05:03:13PM +0000, Julien Grall wrote:
> > > > > > If we use hvm_params for this, we need two new hvm_params and Xen
> > > > > > needs
> > > > > > to unmap the pfn from the guest immediately, because we don't want
> > > > > > the
> > > > > > guest to have access to it.
> > > > > 
> > > > > If you unmap the pfn, the PV backend will not be able to request the
> > > > > page
> > > > > because there will be no translation available.
> > > > > 
> > > > > So what you want to do is preventing the guest to at least write into
> > > > > region
> > > > > (not sure if it is worth to restrict read)
> > > > 
> > > > That's a good idea.
> > > > 
> > > > 
> > > > > and unmap the page via the hypercall XENMEM_decrease_reservation.
> > > > 
> > > > That would be issued by the guest itself, right? To save address space?
> > > 
> > > Correct. The main use case today is ballooning, but guest could call it on
> > > any
> > > other RAM baked page.
> > > 
> > > I was thinking about more about the protection needed. Technically the
> > > data in
> > > the ring are not trusted. So if the guest is messing up with it, it would
> > > not
> > > be a big issue. Or did I miss anything here?
> > 
> > I understand that a guest would be smart to call
> > XENMEM_decrease_reservation on the PV console page for pl011, but it
> > cannot be a security measure, because, in fact, it needs to be called by
> > the guest.  Of course, a malicious guest can simply not call
> > XENMEM_decrease_reservation for it.
> 
> Sorry I was not clear. I was not suggested the guest to call
> XENMEM_decrease_reservation on ring for security but a malicious guest issuing
> the hypercall on the ring protected and replacing by another page.
> 
> This is the exact same problem as the one I mentioned on the ITS thread. The
> page live in guest memory but contains data that will only be touched by Xen.
> 
> If you remove those page from stage-2, the translation IPA -> MFN will be lost
> unless you store somewhere else. You would have to do it per-page as the
> buffer will use contiguous IPA but potentially noncontiguous MFN.
> 
> In the case of ITS the memory is provisioned by the guest. So there are not
> much to do there except adding protection in stage-2 such as write protection
> and preventing the guest to unmap it. However for the pl011 ring, as Andrew
> pointed on IRC, what we need to do is accounting this page to the domain
> memory. No mapping is necessary in stage-2.

Thanks Julien for the explanation. I think you are right.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-01-03 19:38 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 15:29 Xen ARM - Exposing a PL011 to the guest Julien Grall
2016-11-30 16:24 ` Christoffer Dall
2016-12-01 15:51   ` Julien Grall
2016-11-30 17:02 ` Volodymyr Babchuk
2016-11-30 22:26 ` Stefano Stabellini
2016-12-01 10:26   ` Christoffer Dall
2016-12-01 21:55     ` Stefano Stabellini
2016-12-16 10:06       ` Bhupinder Thakur
2016-12-16 17:03         ` Julien Grall
2016-12-19 12:20           ` Christoffer Dall
2016-12-19 20:24             ` Stefano Stabellini
2016-12-20  9:46               ` Bhupinder Thakur
2016-12-20 22:29                 ` Stefano Stabellini
2016-12-20 12:32               ` Julien Grall
2016-12-20 19:53                 ` Stefano Stabellini
2016-12-20 20:26                   ` Stefano Stabellini
2016-12-21 19:19                   ` Julien Grall
2016-12-21 22:12                     ` Stefano Stabellini
2016-12-28 17:49                       ` Julien Grall
2016-12-28 17:52                         ` Julien Grall
2016-12-29  9:17                         ` Bhupinder Thakur
2017-01-03 20:08                           ` Stefano Stabellini
2017-01-06 10:18                             ` Bhupinder Thakur
2017-01-06 21:54                               ` Stefano Stabellini
2017-01-10 11:39                                 ` Bhupinder Thakur
2017-01-11  0:22                                   ` Stefano Stabellini
2017-01-17 14:01                                 ` Julien Grall
2017-01-17 13:31                             ` Julien Grall
2017-01-17 19:27                               ` Stefano Stabellini
2017-01-27 12:14                                 ` Bhupinder Thakur
2017-01-27 19:13                                   ` Stefano Stabellini
2017-01-29 11:06                                   ` Christoffer Dall
2017-02-03 13:53                                     ` Bhupinder Thakur
2017-02-03 14:08                                       ` Julien Grall
2017-02-08 12:39                                         ` Bhupinder Thakur
2017-02-09  0:10                                           ` Stefano Stabellini
2017-02-13  8:50                                             ` Bhupinder Thakur
2017-02-13 21:44                                               ` Stefano Stabellini
2017-02-15  8:15                                                 ` Bhupinder Thakur
2017-02-15  8:24                                                   ` Bhupinder Thakur
2017-02-15 21:21                                                     ` Stefano Stabellini
2017-02-23 13:15                                                       ` Bhupinder Thakur
2017-02-23 15:00                                                         ` Wei Liu
2017-02-03 14:15                                       ` Christoffer Dall
2017-01-03 19:38                         ` Stefano Stabellini [this message]
2016-12-20 12:47               ` Christoffer Dall
2016-12-20 21:33                 ` Stefano Stabellini
2016-12-21 11:55                   ` Christoffer Dall
2016-12-21 20:32                   ` Julien Grall

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=alpine.DEB.2.10.1701031138050.17742@sstabellini-ThinkPad-X260 \
    --to=sstabellini@kernel.org \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Steve.Capper@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bhupinder.thakur@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=george.dunlap@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --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 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.