]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commit
xen: hvm: restrict handles to only be able to operate on target domain
authorIan Campbell <ian.campbell@citrix.com>
Wed, 27 Jan 2016 15:54:06 +0000 (15:54 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 11 Feb 2016 16:16:42 +0000 (16:16 +0000)
commit7e22e6ac48b19a58e5d0fbcca81bda6ea1bdc3d1
treeeae6760b93fe423aa6309dd8d1489089927e129a
parentb1ff63dbd8d2b42541da91a557b7d3cf129c9c0b
xen: hvm: restrict handles to only be able to operate on target domain

Combined with running as non-root after initialisation this should
limit the damage which a compromised qemu process can do.

Several things TBD:
 - When to do this (only with runas?)
 - Behaviour if cannot lock down (warn vs exit, configurable)
 - How best to structure the above without massive code duplication.
 - Foreign memory handle is opened in common code but locked down in
   xen-hvm, which seems like a dangerous separation of duties (i.e.
   something might get moved and/or forgotten).

Only the handles opened/used by QEMU running as an HVM DM are handled.
In particular handles used as a backend are not locked down, in any
case they need to have the privilege of the backend domain (i.e. the
current one containing the QEMU process), not the frontend, so there
is not much to restrict.

NB gnttab is not used by HVM DM (only by PV backends), so it is not
handled here at all.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
configure
include/hw/xen/xen_common.h
xen-hvm.c