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 B58D21384B4 for ; Fri, 18 Dec 2015 03:49:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5041F21C005; Fri, 18 Dec 2015 03:49:28 +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 9045F21C005 for ; Fri, 18 Dec 2015 03:49:27 +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 3446033BE05 for ; Fri, 18 Dec 2015 03:49:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 42A35A0E for ; Fri, 18 Dec 2015 03:49:21 +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: <1450409579.32b74e9b8029ee9d345c560dd7e59964fd829f62.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/system/, policy/modules/kernel/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/kernel/kernel.te policy/modules/system/mount.te X-VCS-Directories: policy/modules/kernel/ policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 32b74e9b8029ee9d345c560dd7e59964fd829f62 X-VCS-Branch: next Date: Fri, 18 Dec 2015 03:49:21 +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: 906abfd0-47de-49c0-9d8a-f66386f91bae X-Archives-Hash: 401103a386fbdaa2e7eab0838cb98b82 commit: 32b74e9b8029ee9d345c560dd7e59964fd829f62 Author: Jason Zaman perfinion com> AuthorDate: Thu Dec 17 18:38:24 2015 +0000 Commit: Jason Zaman gentoo org> CommitDate: Fri Dec 18 03:32:59 2015 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=32b74e9b Add permissions for ZFS zfs list uses a pipe to get info from the kernel avc: granted { write } for pid=31602 comm="dump_list_strat" path="pipe:[4471132]" dev="pipefs" ino=4471132 scontext=system_u:system_r:kernel_t:s0 tcontext=staff_u:sysadm_r:mount_t:s0-s0:c0.c511 tclass=fifo_file avc: granted { read } for pid=31601 comm="zfs" path="pipe:[4471132]" dev="pipefs" ino=4471132 scontext=staff_u:sysadm_r:mount_t:s0-s0:c0.c511 tcontext=staff_u:sysadm_r:mount_t:s0-s0:c0.c511 tclass=fifo_file zfs send / recv is usually piped somewhere by sysadm zfs send tank@snap | ssh foo tank@snap policy/modules/kernel/kernel.te | 9 +++++++++ policy/modules/system/mount.te | 3 +++ 2 files changed, 12 insertions(+) diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te index 4ac22e0..f1016a3 100644 --- a/policy/modules/kernel/kernel.te +++ b/policy/modules/kernel/kernel.te @@ -461,4 +461,13 @@ ifdef(`distro_gentoo',` # See also bug 535992 #dev_manage_all_dev_nodes(kernel_t) dev_setattr_generic_chr_files(kernel_t) + + # ZFS send/recv writes to an fd + optional_policy(` + sysadm_use_fds(kernel_t) + ') + # zfs list writes to a pipe + optional_policy(` + mount_rw_pipes(kernel_t) + ') ') diff --git a/policy/modules/system/mount.te b/policy/modules/system/mount.te index 497fa59..920abc7 100644 --- a/policy/modules/system/mount.te +++ b/policy/modules/system/mount.te @@ -42,6 +42,9 @@ application_domain(unconfined_mount_t, mount_exec_t) # setuid/setgid needed to mount cifs allow mount_t self:capability { ipc_lock sys_rawio sys_admin dac_override chown sys_tty_config setuid setgid }; +allow mount_t self:process signal; +# zfs list uses pipes +allow mount_t self:fifo_file rw_fifo_file_perms; mount_read_loopback_files(mount_t)