Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6616BC55178 for ; Tue, 27 Oct 2020 17:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0646420878 for ; Tue, 27 Oct 2020 17:37:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="JfnqKW5c" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1820625AbgJ0Rgo (ORCPT ); Tue, 27 Oct 2020 13:36:44 -0400 Received: from esa6.hc3370-68.iphmx.com ([216.71.155.175]:1903 "EHLO esa6.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762142AbgJ0Rbd (ORCPT ); Tue, 27 Oct 2020 13:31:33 -0400 X-Greylist: delayed 427 seconds by postgrey-1.27 at vger.kernel.org; Tue, 27 Oct 2020 13:31:32 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1603819892; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=gZcc2hU14CZtrThMc7DT2to2coPz0NsBzHwweeXC9Xg=; b=JfnqKW5ckm7hRG8fb2KPh5x3CsUfCPrThug5qCRre+e75GZJGJPTxRG5 GqnJC4EoTpRYuqe0Va+D7dGQQnFQjKl4b0ZmydGcbiSMEBGaig5J1SWrO 8Uqtghzr58JibOY6dah5fcFSIUcVeIyiBnT4WraUBScT68auTxIsjfCXF A=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: /w1ssWNClMgQ0bUGdfhLV8+dZw1zj+gG6DZD/S8CF4eahGsyImpqUG+sM8TaYZcr9dTrsQqb0E 5zoSUgURPvbMIoUqOaPOYe7iI2NKWQs+GDWPpmkT7k+0noK2c+3NrJRM+ipu+mekIuVT/2c7SZ lzW4fIyCTGO44xqgco5dj0ONf1Ubn6+PkaRLFvn6qLi5jeKbf0ZqwqQzfzuQ1pajHJqhipRiO4 wP8GCUUdfCPkJfT6gRIBbZMFTa+LApA4UHrdsxrKfszFFArOe+ae+TtcC8mbF62PRETt+KOGbq x1U= X-SBRS: None X-MesageID: 30145894 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,424,1596513600"; d="scan'208";a="30145894" From: Anthony PERARD To: CC: Anthony PERARD Subject: [PATCH v2] xen: Allow xenstored to map /proc/xen/xsd_kva Date: Tue, 27 Oct 2020 17:22:28 +0000 Message-ID: <20201027172228.528204-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org xenstored is using mmap() on /proc/xen/xsd_kva, and when the SELinux boolean "domain_can_mmap_files" in CentOS is set to false the mmap() call fails. Signed-off-by: Anthony PERARD --- v2: Declare an interface instead of using allow in xen.te directly. --- policy/modules/kernel/filesystem.if | 18 ++++++++++++++++++ policy/modules/system/xen.te | 1 + 2 files changed, 19 insertions(+) diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if index b52fc769236b..b85ae2f6e851 100644 --- a/policy/modules/kernel/filesystem.if +++ b/policy/modules/kernel/filesystem.if @@ -5310,6 +5310,24 @@ interface(`fs_manage_xenfs_files',` manage_files_pattern($1, xenfs_t, xenfs_t) ') +######################################## +## +## Map files a XENFS filesystem. +## +## +## +## Domain allowed access. +## +## +# +interface(`fs_mmap_xenfs_files',` + gen_require(` + type xenfs_t; + ') + + allow $1 xenfs_t:file map; +') + ######################################## ## ## Do not audit attempts to create, diff --git a/policy/modules/system/xen.te b/policy/modules/system/xen.te index 2c95d0ca3bbd..82328cbbbaa3 100644 --- a/policy/modules/system/xen.te +++ b/policy/modules/system/xen.te @@ -459,6 +459,7 @@ files_read_usr_files(xenstored_t) fs_search_xenfs(xenstored_t) fs_manage_xenfs_files(xenstored_t) +fs_mmap_xenfs_files(xenstored_t) term_use_generic_ptys(xenstored_t) -- Anthony PERARD