From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1EC0D13888F for ; Sun, 11 Oct 2015 10:48:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9F9D821C05F; Sun, 11 Oct 2015 10:48:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 618E0E0856 for ; Sun, 11 Oct 2015 10:48:41 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3ABD9340686 for ; Sun, 11 Oct 2015 10:48:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3BD68B0A for ; Sun, 11 Oct 2015 10:48:35 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1442731973.50f8ca591816aac7bf881211f9b722955d59fc29.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/kernel/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/kernel/devices.fc policy/modules/kernel/devices.if policy/modules/kernel/devices.te X-VCS-Directories: policy/modules/kernel/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 50f8ca591816aac7bf881211f9b722955d59fc29 X-VCS-Branch: next Date: Sun, 11 Oct 2015 10:48:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8928cda1-925b-4f8c-a742-05a263f4e7f1 X-Archives-Hash: 85f04b6c0b56d516a1fe0a9015b8afa5 Message-ID: <20151011104835.r0edBycsWFuqQ85BanjLiyJUh5lz_bxw7lIQv7VSTRU@z> commit: 50f8ca591816aac7bf881211f9b722955d59fc29 Author: Alexander Wetzel web de> AuthorDate: Sat Sep 5 07:41:48 2015 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sun Sep 20 06:52:53 2015 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=50f8ca59 adds vfio device support to base policy Signed-off-by: Alexander Wetzel web.de> policy/modules/kernel/devices.fc | 1 + policy/modules/kernel/devices.if | 36 ++++++++++++++++++++++++++++++++++++ policy/modules/kernel/devices.te | 3 +++ 3 files changed, 40 insertions(+) diff --git a/policy/modules/kernel/devices.fc b/policy/modules/kernel/devices.fc index d6ebfcd..a33e395 100644 --- a/policy/modules/kernel/devices.fc +++ b/policy/modules/kernel/devices.fc @@ -118,6 +118,7 @@ ifdef(`distro_suse', ` /dev/usbscanner -c gen_context(system_u:object_r:scanner_device_t,s0) ') +/dev/vfio/.+ -c gen_context(system_u:object_r:vfio_device_t,s0) /dev/vhost-net -c gen_context(system_u:object_r:vhost_device_t,s0) /dev/vbi.* -c gen_context(system_u:object_r:v4l_device_t,s0) /dev/vbox.* -c gen_context(system_u:object_r:xserver_misc_device_t,s0) diff --git a/policy/modules/kernel/devices.if b/policy/modules/kernel/devices.if index ed25979..835ec14 100644 --- a/policy/modules/kernel/devices.if +++ b/policy/modules/kernel/devices.if @@ -4611,6 +4611,42 @@ interface(`dev_write_video_dev',` ######################################## ## +## Read and write vfio devices. +## +## +## +## Domain allowed access. +## +## +# +interface(`dev_rw_vfio_dev',` + gen_require(` + type device_t, vfio_device_t; + ') + + rw_chr_files_pattern($1, device_t, vfio_device_t) +') + +######################################## +## +## Relabel vfio devices. +## +## +## +## Domain allowed access. +## +## +# +interface(`dev_relabelfrom_vfio_dev',` + gen_require(` + type device_t, vfio_device_t; + ') + + relabelfrom_chr_files_pattern($1, device_t, vfio_device_t) +') + +############################ +## ## Allow read/write the vhost net device ## ## diff --git a/policy/modules/kernel/devices.te b/policy/modules/kernel/devices.te index 166c8f7..eb12597 100644 --- a/policy/modules/kernel/devices.te +++ b/policy/modules/kernel/devices.te @@ -273,6 +273,9 @@ dev_node(usbmon_device_t) type userio_device_t; dev_node(userio_device_t) +type vfio_device_t; +dev_node(vfio_device_t) + type v4l_device_t; dev_node(v4l_device_t)