From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
xen-devel@lists.xen.org
Subject: Re: Questions about the in-tree Flask policy
Date: Mon, 22 Sep 2014 16:23:01 -0400 [thread overview]
Message-ID: <54208525.3090604@tycho.nsa.gov> (raw)
In-Reply-To: <20140917153837.GE8376@zion.uk.xensource.com>
On 09/17/2014 11:38 AM, Wei Liu wrote:
> Hi Daniel
>
> I'm working to get XSM tested in OSSTest. After hacking for some days
> I've got to the point that I actually have test cases to run.
>
> Our plan is to at least replicate three Debian smoke tests:
> test-amd64-amd64-xl-xsm
> test-amd64-amd64-xl-qemuu-debianhvm-amd64-xsm
> test-amd64-amd64-xl-qemut-debianhvm-amd64-xsm
>
> The -xsm suffix is to distinguish them from the normal non-xsm tests.
>
> However I cannot get the in-tree policy to work with OSSTest. It's much
> stricter than I had anticipated. Guest creation is OK, but it doesn't
> seem to allow "xl save" to run.
This is a policy error; the example policy should permit domain save
operations on domU_t, but currently does not do so.
> In my test-amd64-amd64-xl-xsm run:
>
> 2014-09-17 15:05:39 Z executing ssh ... root@10.80.227.162 xl save debian.guest.osstest image
> Saving to image new xl format (info 0x0/0x0/824)
> xc: error: xc_alloc_hypercall_buffer: mmap failed (22 = Invalid argument): Internal error
> xc: error: Couldn't allocate to_send array: Internal error
> libxl: error: libxl_dom.c:1673:libxl__xc_domain_save_done: saving domain: domain responded to suspend request: Cannot allocate memory
> Failed to save domain, resuming domain
> libxl: error: libxl.c:475:libxl__domain_resume: xc_domain_resume failed for domain 1: Permission denied
> 2014-09-17 15:05:40 Z command nonzero waitstatus 256: ssh -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=100 -o ServerAliveInterval=100 -o PasswordAuthentication=no -o ChallengeResponseAuthentication=no -o UserKnownHostsFile=tmp/t.known_hosts_standalone.test-amd64-amd64-xl-xsm root@10.80.227.162 xl save debian.guest.osstest image
> status 256 at Osstest/TestSupport.pm line 391.
> + rc=1
> + date -u +%Y-%m-%d %H:%M:%S Z exit status 1
> 2014-09-17 15:05:40 Z exit status 1
> + exit 1
>
> The guest has seclabel='system_u:system_r:domU_t'.
>
> In 'xl dmesg' there are some avc messages (removed duplicated ones):
>
> (XEN) Cannot bind IRQ4 to dom0. In use by 'ns16550'.
> (XEN) Cannot bind IRQ2 to dom0. In use by 'cascade'.
> (XEN) avc: denied { cacheflush } for domid=0 target=1 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=domain2
> (XEN) avc: denied { stat } for domid=0 target=1 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=mmu
> (XEN) avc: denied { getvcpucontext } for domid=0 target=1 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=domain
> (XEN) avc: denied { cacheflush } for domid=0 target=3 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=domain2
>
> I tried to look at the policy file(s), only to find out that there's a
> bunch of files that have excessive amount of information. I'm certainly
> not an XSM expert and have no intention to become one at the moment. :-)
True, and you shouldn't have to be an expert to report errors (your current
report was exactly what was needed to fix the policy).
In the future, any AVC denied messages in the output when under normal test
operation (i.e. not when a VM is misbehaving) should be treated as a bug in
the XSM policy even when it doesn't cause real failures. Usually, the answer
is to add the permission to the proper part of the policy, and the denial
will cause operations to break (like the above errors). In some other cases,
such as cacheflush, the process continues but was not able to perform an
important operation. If this is something that can be easily added to the
test script as a failure condition, that would be helpful (but this is
certainly not a prerequisite for adding the tests in the first place).
--
Daniel De Graaf
National Security Agency
next prev parent reply other threads:[~2014-09-22 20:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 15:38 Questions about the in-tree Flask policy Wei Liu
2014-09-17 16:39 ` Ian Campbell
2014-09-22 20:23 ` Daniel De Graaf [this message]
2014-09-23 9:49 ` Wei Liu
2014-09-23 9:53 ` Ian Campbell
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=54208525.3090604@tycho.nsa.gov \
--to=dgdegra@tycho.nsa.gov \
--cc=Ian.Jackson@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/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).