From patchwork Thu Jul 7 13:45:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Anshul Makkaranshul.makkar"@citrix.com X-Patchwork-Id: 9218979 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 E6CDA60B16 for ; Thu, 7 Jul 2016 13:47:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA68E26223 for ; Thu, 7 Jul 2016 13:47:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF3C42623C; Thu, 7 Jul 2016 13:47:49 +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 B134826224 for ; Thu, 7 Jul 2016 13:47:48 +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 1bL9cu-0001Ii-JI; Thu, 07 Jul 2016 13:46:00 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) id 1bL9cs-0001Ib-Te for xen-devel@lists.xen.org; Thu, 07 Jul 2016 13:45:59 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id 95/F8-26908-61D5E775; Thu, 07 Jul 2016 13:45:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeJIrShJLcpLzFFi42JxWrohUlc0ti7 coH2WhsWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmrH76jmmgs+cFZ+3fGRtYLzJ0cXIySEh4C/x etMmFhCbTUBPYsLN/YwgtoiArMTqrjnsIDazQJXE++atTCC2sEClRMeGE0A1HBwsAioSX37Lg oR5BTwk1raeZIYYKSdx8thkVpASIQF+iQm3qyBKBCVOznzCAjFRQuLgixfMICUSAtwSf7vtJz DyzEJSNQtJ1QJGplWMGsWpRWWpRbpGRnpJRZnpGSW5iZk5uoYGpnq5qcXFiempOYlJxXrJ+bm bGIHhUc/AwLiDcU+73yFGSQ4mJVFeBf+6cCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvEUxQDnB otT01Iq0zBxgoMKkJTh4lER4HUHSvMUFibnFmekQqVOMuhx/pl5fyyTEkpeflyolzssBUiQAU pRRmgc3AhY1lxhlpYR5GRkYGIR4ClKLcjNLUOVfMYpzMCoJ82aDTOHJzCuB2/QK6AgmoCN+ul SDHFGSiJCSamA0OOaix3984b/dfttyXt20LbWcf6li5aYIkd/aDXLVCZ8a9aa2+Sotuap/7VN h3uSZq3/MT3i4asdt2aDf76M0hAX6vN9KJb69KCNgovt9mZ7djD6Tr9FCeZOzZ8Tf5pp1lcfI z3T6tqZ4V/kCTUGprNWqUqqrVx5jMpaYqLnMQCN31sw7nC5KLMUZiYZazEXFiQAGpuhHlQIAA A== X-Msg-Ref: server-2.tower-206.messagelabs.com!1467899156!32946071!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51268 invoked from network); 7 Jul 2016 13:45:57 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 7 Jul 2016 13:45:57 -0000 X-IronPort-AV: E=Sophos;i="5.28,324,1464652800"; d="scan'208";a="364846046" From: <"Anshul Makkaranshul.makkar"@citrix.com> To: Date: Thu, 7 Jul 2016 14:45:47 +0100 Message-ID: <1467899147-22315-1-git-send-email-anshul.makkar@citrix.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-DLP: MIA1 Cc: ian.jackson@eu.citrix.com, dgdegra@tycho.nsa.gov, wei.liu2@citrix.com, Anshul Makkar Subject: [Xen-devel] [PATCH] XSM/policy: Allow the source domain access to settime and setdomainhandle domctls while creating domain. 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Anshul Makkar This patch resolves the following permission denied scenarios while creating new domU : avc: denied { setdomainhandle } for domid=0 target=1 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=domain avc: denied { settime } for domid=0 target=1 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=domain Signed-off-by: Anshul Makkar Acked-by: Daniel De Graaf --- tools/flask/policy/modules/xen.if | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/flask/policy/modules/xen.if b/tools/flask/policy/modules/xen.if index fd96303..8c43c28 100644 --- a/tools/flask/policy/modules/xen.if +++ b/tools/flask/policy/modules/xen.if @@ -48,7 +48,8 @@ define(`declare_build_label', ` define(`create_domain_common', ` allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize getdomaininfo hypercall setvcpucontext getscheduler - getvcpuinfo getaddrsize getaffinity setaffinity }; + getvcpuinfo getaddrsize getaffinity setaffinity + settime setdomainhandle }; allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim set_max_evtchn set_vnumainfo get_vnumainfo cacheflush psr_cmt_op psr_cat_op soft_reset };