xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xen.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>, xen-devel@lists.xensource.com
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH 6/8] libxl: Add device_model_stubdomain_seclabel
Date: Thu, 02 Feb 2012 15:28:02 +0000	[thread overview]
Message-ID: <CB505C02.38E31%keir@xen.org> (raw)
In-Reply-To: <1328123365-12490-7-git-send-email-dgdegra@tycho.nsa.gov>

On 01/02/2012 19:09, "Daniel De Graaf" <dgdegra@tycho.nsa.gov> wrote:

> This allows the security label of stub domains to be specified.
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>

This and patch 7/8 I assume will be picked up by a libxl maintainer (cc'ing
Ian Jackson). All your other outstanding patches I have now applied.

 -- Keir

> ---
>  docs/man/xl.cfg.pod.5       |    4 ++++
>  tools/libxl/libxl_dm.c      |    1 +
>  tools/libxl/libxl_types.idl |    1 +
>  tools/libxl/xl_cmdimpl.c    |   12 ++++++++++++
>  4 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 9d90290..8f171b4 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -789,6 +789,10 @@ Override the use of stubdomain based device-model.
> Normally this will
>  be automatically selected based upon the other features and options
>  you have selected.
>  
> +=item B<device_model_stubdomain_seclabel="LABEL">
> +
> +Assign an XSM security label to the device-model stubdomain.
> +
>  =item B<device_model_args=[ "ARG", "ARG", ...]>
>  
>  Pass additional arbitrary options on the devide-model command
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index 5fec137..e99d173 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -703,6 +703,7 @@ static int libxl__create_stubdom(libxl__gc *gc,
>      dm_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
>      dm_config.c_info.name = libxl__sprintf(gc, "%s-dm",
>                                      libxl__domid_to_name(gc, guest_domid));
> +    dm_config.c_info.ssidref = guest_config->b_info.device_model_ssidref;
>  
>      libxl_uuid_generate(&dm_config.c_info.uuid);
>  
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 3c24626..b77bc65 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -217,6 +217,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>      ("device_model_stubdomain", bool),
>      # you set device_model you must set device_model_version too
>      ("device_model",     string),
> +    ("device_model_ssidref", uint32),
>  
>      # extra parameters pass directly to qemu, NULL terminated
>      ("extra",            libxl_string_list),
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 0b811b5..e95bace 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -1254,6 +1254,18 @@ skip_vfb:
>      if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l,
> 0))
>          b_info->device_model_stubdomain = l;
>  
> +    if (!xlu_cfg_get_string (config, "device_model_stubdomain_seclabel",
> &buf, 0)) {
> +        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
> +                                    &b_info->device_model_ssidref);
> +        if (e) {
> +            if (errno == ENOSYS) {
> +                fprintf(stderr, "XSM Disabled:
> device_model_stubdomain_seclabel not supported\n");
> +            } else {
> +                fprintf(stderr, "Invalid device_model_stubdomain_seclabel:
> %s\n", buf);
> +                exit(1);
> +            }
> +        }
> +    }
>  #define parse_extra_args(type)                                            \
>      e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
>                                      &b_info->extra##type, 0);            \

  reply	other threads:[~2012-02-02 15:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 21:26 [PATCH 00/10] FLASK updates: MSI interrupts, cleanups Daniel De Graaf
2012-01-31 21:26 ` [PATCH 01/10] xsm: Add security labels to event-channel dump Daniel De Graaf
2012-01-31 21:26 ` [PATCH 02/10] xsm: Add security label to IRQ debug output Daniel De Graaf
2012-01-31 21:26 ` [PATCH 03/10] xsm/flask: Use PCI device label for PCI-MSI IRQs Daniel De Graaf
2012-01-31 21:26 ` [PATCH 04/10] xsm: Add xsm_map_domain_pirq hook Daniel De Graaf
2012-01-31 21:26 ` [PATCH 05/10] xsm: Use mapped IRQ not PIRQ in unmap_domain_pirq Daniel De Graaf
2012-01-31 21:26 ` [PATCH 06/10] xsm/flask: Improve error reporting for ocontexts Daniel De Graaf
2012-01-31 21:26 ` [PATCH 07/10] xsm/flask: Remove useless back pointers Daniel De Graaf
2012-01-31 21:26 ` [PATCH 08/10] flask/policy: Policy build updates Daniel De Graaf
2012-01-31 21:26 ` [PATCH 09/10] flask/policy: Add user and constraint examples Daniel De Graaf
2012-01-31 21:26 ` [PATCH 10/10] flask/policy: use declare_domain for dom0_t Daniel De Graaf
2012-02-01 19:09 ` [PATCH 0/8] XSM/FLASK updates part 2: booleans, stubdoms Daniel De Graaf
2012-02-01 19:09   ` [PATCH 1/8] xen/xsm: fix incorrect handling of XSM hook return Daniel De Graaf
2012-02-01 19:09   ` [PATCH 2/8] xsm/flask: allow policy booleans to be addressed by name Daniel De Graaf
2012-02-01 19:09   ` [PATCH 3/8] libflask: Add boolean manipulation functions Daniel De Graaf
2012-02-02  9:06     ` Ian Campbell
2012-02-02 14:28       ` Daniel De Graaf
2012-02-02 14:50         ` Ian Campbell
2012-02-02 15:22           ` Daniel De Graaf
2012-02-01 19:09   ` [PATCH 4/8] flask: add flask-{get,set}-bool tools Daniel De Graaf
2012-02-01 19:09   ` [PATCH 5/8] flask/policy: Add boolean example Daniel De Graaf
2012-02-01 19:09   ` [PATCH 6/8] libxl: Add device_model_stubdomain_seclabel Daniel De Graaf
2012-02-02 15:28     ` Keir Fraser [this message]
2012-02-09 18:25     ` Ian Jackson
2012-02-01 19:09   ` [PATCH 7/8] flask/policy: add device model types to example policy Daniel De Graaf
2012-02-09 18:25     ` Ian Jackson
2012-02-01 19:09   ` [PATCH 8/8] xsm/flask: Improve domain ID auditing in AVCs Daniel De Graaf

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=CB505C02.38E31%keir@xen.org \
    --to=keir@xen.org \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).