From: Samuel Thibault Subject: Re: [PATCH 3 of 7] xen: allows more hypercalls from stubdoms Date: Tue, 13 Oct 2009 16:36:37 +0200 Message-ID: <20091013143637.GT5663@const.bordeaux.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , Keir Fraser List-Id: xen-devel@lists.xenproject.org Stefano Stabellini, le Tue 13 Oct 2009 15:24:31 +0100, a =E9crit : > =20 > - if ( !IS_PRIV(current->domain) ) > - return -EPERM; > - > if ( copy_from_guest(op, u_domctl, 1) ) > return -EFAULT; > =20 > if ( op->interface_version !=3D XEN_DOMCTL_INTERFACE_VERSION ) > return -EACCES; > + > + switch ( op->cmd ) > + { > + case XEN_DOMCTL_ioport_mapping: > + case XEN_DOMCTL_memory_mapping: > + case XEN_DOMCTL_bind_pt_irq: > + case XEN_DOMCTL_unbind_pt_irq: > + case XEN_DOMCTL_assign_device: > + case XEN_DOMCTL_deassign_device: > +#ifdef PRIVILEGED_STUBDOMS > + { > + struct domain *d =3D get_domain_by_id(op->domain); > + if ( !IS_PRIV_FOR(current->domain, d) ) > + { > + put_domain(d); > + return -EPERM; > + } > + put_domain(d); > + } > + break; > +#endif > + default: > + if ( !IS_PRIV(current->domain) ) > + return -EPERM; > + break; > + } > + > =20 > if ( !domctl_lock_acquire() ) The cases should be inside the #ifdef, or there should be a #else. Samuel