From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v7 10/10] xen/common: do not implicitly permit access to mapped I/O memory Date: Sun, 25 May 2014 18:14:57 +0100 Message-ID: <53822511.1040604@linaro.org> References: <1399305254-3695-1-git-send-email-avanzini.arianna@gmail.com> <1399305254-3695-11-git-send-email-avanzini.arianna@gmail.com> <5368C22B020000780000F3C9@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5368C22B020000780000F3C9@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Arianna Avanzini Cc: julien.grall@citrix.com, paolo.valente@unimore.it, keir@xen.org, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, Ian.Campbell@eu.citrix.com, etrudeau@broadcom.com, tim@xen.org, viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org Hi Jan, On 06/05/14 10:06, Jan Beulich wrote: >> @@ -838,7 +842,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) >> break; >> >> ret = -EPERM; >> - if ( !iomem_access_permitted(current->domain, mfn, mfn_end) ) >> + if ( !iomem_access_permitted(d, mfn, mfn_end) ) > > I'm not sure if we shouldn't rather be conservative here and check > both domains' permissions. I think we only need to check the permission of the current domain. Checking the permission of the guest is not necessary here. Hence, the code to map a region will be more difficult. We will have first call iomem_permission then call memory_mapping. I would prefer to keep the current permission check ie: if ( !iomem_access_permitted(current->domain, ...) ) Regards, -- Julien Grall