From patchwork Mon May 23 15:05:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel De Graaf X-Patchwork-Id: 9131975 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E64EC60761 for ; Mon, 23 May 2016 15:08:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD9EC2822F for ; Mon, 23 May 2016 15:08:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D27F228239; Mon, 23 May 2016 15:08:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 84C052822F for ; Mon, 23 May 2016 15:08:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4rQm-0000xr-If; Mon, 23 May 2016 15:06:08 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4rQk-0000wW-Re for xen-devel@lists.xenproject.org; Mon, 23 May 2016 15:06:06 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 6A/E2-20564-E5C13475; Mon, 23 May 2016 15:06:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRWlGSWpSXmKPExsXCoZPKqRsr4xx u8GqWpsX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmrFmo0HBTIGKhj7fBsa1fF2MnBwSAn4S7d8m snUxcnFwCixnkfg+YzoriCMhsINR4tWtj8wgVUICSxklGrfxgySEBLYxSvTvWcAOkmAT0JVYc HAlE4gtIqAkcW/VZDCbWaBI4vLqRWC2sICVxKXP91hAbBYBVYnFzy+zgdi8Aq4Sn9+fZIY4Q0 5i25Y9jCA2p4CbxOz904BsDqBlrhJTpilPYORbwMiwilG9OLWoLLVI11gvqSgzPaMkNzEzR9f QwFQvN7W4ODE9NScxqVgvOT93EyMwRBiAYAfj3n9OhxglOZiURHlP7nAKF+JLyk+pzEgszogv Ks1JLT7EKMPBoSTB+0bKOVxIsCg1PbUiLTMHGKwwaQkOHiUR3j8gad7igsTc4sx0iNQpRkUpc V5BaaCEAEgiozQPrg0WIZcYZaWEeRmBDhHiKUgtys0sQZV/xSjOwagkzOsGMoUnM68EbvoroM VMQIsfSjuALC5JREhJNTBu7l/xOG7pzZdC0R1m58/8rl2mb1Ws9Sb2+cR9rDy3X4jLum7hez/ 9wmym90zHDB9fZGx2S54rU++9Wzm0/+K1d61vAyrOxh04nuJwYAefe5Yzz7HL4gdVN8kd8bYV YGrluv30lM1+NoPcdUcrHq3fsfQL34WY+Joct8fJlwO+PBbgWf/AK8tbiaU4I9FQi7moOBEA8 m4w+YsCAAA= X-Env-Sender: dgdegra@tycho.nsa.gov X-Msg-Ref: server-15.tower-206.messagelabs.com!1464015962!29076698!4 X-Originating-IP: [8.44.101.9] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9864 invoked from network); 23 May 2016 15:06:05 -0000 Received: from emsm-gh1-uea11.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) (8.44.101.9) by server-15.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 23 May 2016 15:06:05 -0000 X-IronPort-AV: E=Sophos;i="5.26,356,1459814400"; d="scan'208";a="16352621" IronPort-PHdr: =?us-ascii?q?9a23=3AzEEmFh2faXshHFwQsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?segQIvad9pjvdHbS+e9qxAeQG96LurQf2qGJ7OjJYi8p39WoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09?= =?us-ascii?q?fr2zQd6DyZ/mnL/ts7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP?= =?us-ascii?q?5Xz247bXianhL7+9vitMU7q3cYhuglv/Jkfe26Ov5gDO8QMDNzI20zocHmqxTH?= =?us-ascii?q?ZQ+O/WcHFHUblAJSBArI5w28WY3+4QXgse8o9CCcPMDyBZw5ERu45q5lAEvkhy?= =?us-ascii?q?sKOCQw2H3Ggcx3yqRAqVSuoAIpkN2cW52cKPcrJvCVRtgdX2cUG5wJWg=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2HqBADyG0NX/wHyM5BcHAGDGoFTt3GEFIYRAoEvTAEBAQE?= =?us-ascii?q?BAQICYieCLYIWAgR5EBg5VxmIL8R6AQEBBwIBJI9/hQ4FmDeOIAKJVoVEj0xih?= =?us-ascii?q?AkgMolRAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2016 15:05:38 +0000 Received: from moss-nexus.infosec.tycho.ncsc.mil (moss-nexus [192.168.25.48]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u4NF5YU8020519; Mon, 23 May 2016 11:05:38 -0400 From: Daniel De Graaf To: xen-devel@lists.xenproject.org Date: Mon, 23 May 2016 11:05:32 -0400 Message-Id: <1464015933-26891-5-git-send-email-dgdegra@tycho.nsa.gov> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464015933-26891-1-git-send-email-dgdegra@tycho.nsa.gov> References: <1464015933-26891-1-git-send-email-dgdegra@tycho.nsa.gov> Cc: steve@zentific.com, Daniel De Graaf , cardoe@cardoe.com Subject: [Xen-devel] [PATCH 4/5] flask/policy: xenstore stubdom policy X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This adds the xenstore_t type to the example policy for use by a xenstore stub domain. Signed-off-by: Daniel De Graaf --- tools/flask/policy/modules/modules.conf | 3 +++ tools/flask/policy/modules/xenstore.te | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tools/flask/policy/modules/xenstore.te diff --git a/tools/flask/policy/modules/modules.conf b/tools/flask/policy/modules/modules.conf index 2dfc011..8ffd00e 100644 --- a/tools/flask/policy/modules/modules.conf +++ b/tools/flask/policy/modules/modules.conf @@ -33,6 +33,9 @@ nomigrate = on # Example device policy. Also see policy/device_contexts. nic_dev = on +# Xenstore stub domain. +xenstore = on + # Allow all domains to use system_u:system_r: instead of requiring explicit # roles. This is not required for dom0_t, domU_t, and dm_dom_t. default_role = on diff --git a/tools/flask/policy/modules/xenstore.te b/tools/flask/policy/modules/xenstore.te new file mode 100644 index 0000000..2ae7a1d --- /dev/null +++ b/tools/flask/policy/modules/xenstore.te @@ -0,0 +1,21 @@ +################################################################################ +# +# Xenstore stubdomain +# +################################################################################ +declare_singleton_domain(xenstore_t) +create_domain(dom0_t, xenstore_t) +manage_domain(dom0_t, xenstore_t) + +# Xenstore requires the global VIRQ for domain destroy operations +allow dom0_t xenstore_t:domain set_virq_handler; +# Current xenstore stubdom uses the hypervisor console, not "xl console" +allow xenstore_t xen_t:xen writeconsole; +# Xenstore queries domaininfo on all domains +allow xenstore_t domain_type:domain getdomaininfo; + +# As a shortcut, the following 3 rules are used instead of adding a domain_comms +# rule between xenstore_t and every domain type that talks to xenstore +create_channel(xenstore_t, domain_type, xenstore_t_channel) +allow event_type xenstore_t: event bind; +allow xenstore_t domain_type:grant { map_read map_write unmap };