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 9E2361384B4 for ; Fri, 18 Dec 2015 04:14:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D9C921C003; Fri, 18 Dec 2015 04:14: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 CF84A21C003 for ; Fri, 18 Dec 2015 04:14:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2052340634 for ; Fri, 18 Dec 2015 04:14:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7A00AA46 for ; Fri, 18 Dec 2015 04:14:25 +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: <1450411971.b0cfc980dcefdffcdcf2929394278e3ea983a88c.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/kernel/, policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/kernel/kernel.te policy/modules/system/mount.te X-VCS-Directories: policy/modules/system/ policy/modules/kernel/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: b0cfc980dcefdffcdcf2929394278e3ea983a88c X-VCS-Branch: master Date: Fri, 18 Dec 2015 04:14:25 +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: 83fd8bdd-a034-43ec-989f-44019a47dace X-Archives-Hash: b804bc4771829db011fa6c1d36a9765f Message-ID: <20151218041425.zeHUDTmN1-K6MM4eaHNcZojyyKRGfaWI2-OctlIFjyc@z> commit: b0cfc980dcefdffcdcf2929394278e3ea983a88c Author: Jason Zaman perfinion com> AuthorDate: Thu Dec 17 18:38:24 2015 +0000 Commit: Jason Zaman gentoo org> CommitDate: Fri Dec 18 04:12:51 2015 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=b0cfc980 Add permissions for ZFS list and send/recv 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)