* Re: [Xen-devel] [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain [not found] ` <E1XCr4p-0007Nh-Qu@lists.xen.org> @ 2014-07-31 17:49 ` George Dunlap 2014-07-31 17:58 ` David Vrabel 0 siblings, 1 reply; 4+ messages in thread From: George Dunlap @ 2014-07-31 17:49 UTC (permalink / raw) To: David Vrabel Cc: Ian Campbell, Frediano Ziglio, xen-devel, Boris Ostrovsky, linux-api, linux-kernel On Thu, Jul 31, 2014 at 10:11 AM, David Vrabel <david.vrabel@citrix.com> wrote: > On 31/07/14 14:53, Ian Campbell wrote: >> On Thu, 2014-07-31 at 14:16 +0100, Frediano Ziglio wrote: >> >>> include/xen/interface/domctl.h | 1090 ++++++++++++++++++++++++++++++++++++ >> >> domctl is an stable toolstack only hypervisor interface, so the kernel >> cannot use it because it would then break. > > Ok. I guess we'll have to resurrect the idea to do something with XSM. What kind of thing did you have in mind for XSM? In general it seems like allowing a vcpu to switch into an XSM label (not sure I've got the terminology right here) when it context switches into a particular process might be the most flexible way for that to work. But would that actually be easier than implementing stub domains? -George ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xen-devel] [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain 2014-07-31 17:49 ` [Xen-devel] [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain George Dunlap @ 2014-07-31 17:58 ` David Vrabel 0 siblings, 0 replies; 4+ messages in thread From: David Vrabel @ 2014-07-31 17:58 UTC (permalink / raw) To: George Dunlap Cc: Ian Campbell, Frediano Ziglio, xen-devel, Boris Ostrovsky, linux-api, linux-kernel On 31/07/14 18:49, George Dunlap wrote: > On Thu, Jul 31, 2014 at 10:11 AM, David Vrabel <david.vrabel@citrix.com> wrote: >> On 31/07/14 14:53, Ian Campbell wrote: >>> On Thu, 2014-07-31 at 14:16 +0100, Frediano Ziglio wrote: >>> >>>> include/xen/interface/domctl.h | 1090 ++++++++++++++++++++++++++++++++++++ >>> >>> domctl is an stable toolstack only hypervisor interface, so the kernel >>> cannot use it because it would then break. >> >> Ok. I guess we'll have to resurrect the idea to do something with XSM. > > What kind of thing did you have in mind for XSM? A multicall-like hypercall that has an additional parameter for a handle to a XSM context to use for the contained hypercalls. > In general it seems like allowing a vcpu to switch into an XSM label > (not sure I've got the terminology right here) when it context > switches into a particular process might be the most flexible way for > that to work. I think we want something than can a different policy on a per-fd basis. David ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <E1XCqEY-0005zn-V2@lists.xen.org>]
* Re: [Xen-devel] [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain [not found] <E1XCqEY-0005zn-V2@lists.xen.org> @ 2014-08-01 8:27 ` Jan Beulich 2014-08-01 13:44 ` Frediano Ziglio 0 siblings, 1 reply; 4+ messages in thread From: Jan Beulich @ 2014-08-01 8:27 UTC (permalink / raw) To: Frediano Ziglio Cc: David Vrabel, xen-devel, Boris Ostrovsky, Konrad Rzeszutek Wilk, linux-api, linux-kernel >>> On 31.07.14 at 15:16, <frediano.ziglio@citrix.com> wrote: > Add a RESTRICT ioctl to /dev/xen/privcmd, which allows privileged commands > file descriptor to be restricted to only working with a particular domain. The "with" here has been quite confusing, and I realized that you mean the subject domain rather than the actor one only after having gone through quite some parts of the patch. For a patch this size, a little more of a description (and the original motivation) would have helped. Wrt motivation: Why does this need enforcing in the kernel at all? Doesn't XSM_DM_PRIV mode deal specifically with what you're trying to do here? Or else I guess I really need some better explanation of what this is about. Jan ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xen-devel] [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain 2014-08-01 8:27 ` Jan Beulich @ 2014-08-01 13:44 ` Frediano Ziglio 0 siblings, 0 replies; 4+ messages in thread From: Frediano Ziglio @ 2014-08-01 13:44 UTC (permalink / raw) To: Jan Beulich Cc: David Vrabel, xen-devel, Boris Ostrovsky, Konrad Rzeszutek Wilk, linux-api, linux-kernel On Fri, 2014-08-01 at 09:27 +0100, Jan Beulich wrote: > >>> On 31.07.14 at 15:16, <frediano.ziglio@citrix.com> wrote: > > Add a RESTRICT ioctl to /dev/xen/privcmd, which allows privileged commands > > file descriptor to be restricted to only working with a particular domain. > > The "with" here has been quite confusing, and I realized that you > mean the subject domain rather than the actor one only after > having gone through quite some parts of the patch. For a patch > this size, a little more of a description (and the original motivation) > would have helped. > Yes, you are right. > Wrt motivation: Why does this need enforcing in the kernel at all? > Doesn't XSM_DM_PRIV mode deal specifically with what you're > trying to do here? Or else I guess I really need some better > explanation of what this is about. > > Jan > This is quite old for me but you are right, perhaps is not that clear for other people. In XenServer we have some patches that allow Qemu running in dom0 but work only for a specific domain. The patches required changes to libxc, kernel and Qemu. We are reimplementing these patches as the old implementation has some problems (one is that the patch for libxc was quite big). This feature was removed as kernel patches did not work with newer (3.x) kernels. Now, XSM_DM_PRIV works checking if the domain target is the domain we are going to handle. However if your dom0 (as in XenServer) has all Qemu to handle all VMs it cannot be bound to a single target so XSM is not usable. Xen has no knowledge of process or file descriptor (which are kernel specific) so there is actually no way it can distinguish which domain should be restricted to. It would solve if the restriction would be done for system call (so we can say execute this hypercall(s) with these policies). However this require to change the target to be at least CPU specific and handle preemption correctly in order to not mix policies. This could be quite heavy so we hack the kernel in order to do the restriction instead (it also was easier to port the patches). Actually changes in Qemu to handle the privcmd/evtchn restrictions are quite small, mainly restrict these two handles with an ioctl. Other parts of the patch (chroot, setuid, groups, resource limits, and mostly xenstore accesses) are more heavy. Frediano ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-01 13:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <E1XCqEY-0005zn-RQ@lists.xen.org>
[not found] ` <1406814787.10395.2.camel@kazak.uk.xensource.com>
[not found] ` <E1XCr4p-0007Nh-Qu@lists.xen.org>
2014-07-31 17:49 ` [Xen-devel] [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain George Dunlap
2014-07-31 17:58 ` David Vrabel
[not found] <E1XCqEY-0005zn-V2@lists.xen.org>
2014-08-01 8:27 ` Jan Beulich
2014-08-01 13:44 ` Frediano Ziglio
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox