Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3588672ybv; Sun, 16 Feb 2020 00:54:37 -0800 (PST) X-Google-Smtp-Source: APXvYqx29qm+Aqv9+DfeVYc5Y48tb6tzHrsl6t5+G5sx3it6sBA7H9FbDwZvPISHm3Z5WBT0fHEM X-Received: by 2002:a05:6830:18ce:: with SMTP id v14mr8143430ote.36.1581843277130; Sun, 16 Feb 2020 00:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581843277; cv=none; d=google.com; s=arc-20160816; b=USNCX4lYtS/UaFREI9xYf1sm/DlwSsbTUmdVg2t+AQ0RQvKPaJwPv2rNDkc/xjSVWh JaA6USiEx6MXMhjq6QEY8tvpmnySwVNTPEhO6N/RUMuauYMwAMEd7tYDjtOzwh+BoBUm KU+lP0tNPqlMVooRWCXIW6AfEZQzZv2I6uL2cKcGjbbum12lMresA1Oy3H/DBROb41qS zcv/TLZu2k9Rg7egh3lWxYO8G6ufEyTMWdbGGMg8aNpE0NP0OCz7UxuiNQfcuuD9RPUC QXRsSiXacF5cIgQl8dOvQJLzdw4SUCiKaEViaO4kTWTaOCkNU4cNrfiZKNOHmELaOrAK DtpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tng11ASdAWgknr2XhdkPSId5V24X8Tn7Rp3S17ejfPA=; b=ubAHWZag0lBTfvpRRlBvKt5wqWUqt0yKtJQt2YMqm3XaQazVM6+Mi4ffpHwHnNruJI KHPP8p7tW94pL1UX8o7Kl+R8haLi1DIhQcxWcoq1f/limcKrfBRyWZdRe62ncQ6ll/4B XRsoVcUp3JQH7h+ABZiH7g6P7TZgexfPNSLmdp63RmoGVdgTVUGT77vJ8TbrgN7TXrrv 1y5koBiBaPIVCNotTD32PbQ6f8FSFpEqY5eX5bNDTyqx8F7sJ3TF6z0byJeJUK2F7kfp TByml8cCYmm6OtH5/qp8YiaKqP8Ke+K2iS1vuP8Tf1E33u59My4wXGstUY/2SKs96HQa lM9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perfinion-com.20150623.gappssmtp.com header.s=20150623 header.b=hMyDN2BV; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si4879208oij.97.2020.02.16.00.54.31; Sun, 16 Feb 2020 00:54:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@perfinion-com.20150623.gappssmtp.com header.s=20150623 header.b=hMyDN2BV; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726020AbgBPIya (ORCPT + 13 others); Sun, 16 Feb 2020 03:54:30 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45300 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgBPIy3 (ORCPT ); Sun, 16 Feb 2020 03:54:29 -0500 Received: by mail-pg1-f196.google.com with SMTP id b9so7299162pgk.12 for ; Sun, 16 Feb 2020 00:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perfinion-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tng11ASdAWgknr2XhdkPSId5V24X8Tn7Rp3S17ejfPA=; b=hMyDN2BV2gWfMTT4oagaSUVh3iayv4KTvmJhZW+Oaj1wNrqYu8kFT7Giw8QPDpqfgS HzwMD1ko7nmshs4vFFeN0RIXnsMZ5dpe0pDh2AKLpc5Xs72Jw+JpRoo3j+LnH5/v/irw xeeF2uqDX5JDUWGFw+gmeoq68NPv2inPAo3aJCrOsfwKTF7c7/iFInrvrk6hLjjU59bZ 09km2BDuete0FTCQkQUjGoJTHB517Cl1KkJKtuE5+7XevUTrHwGgBfA6pnPLbiMOyJfG 3LtfAl3rnGheh7X+lKhP81SzW+zXBYfIvu0wlDcVdhSpPkZqw/PHALbqNf3bv1zB2ULz 9pSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tng11ASdAWgknr2XhdkPSId5V24X8Tn7Rp3S17ejfPA=; b=sgf0TAtN8h94czCvtEtiFbkKZriCY+L7zVrXCxvPsKYA5gMhps4wOMThjvT1OKaqrU YE0yzD0mi4OrzfPDAqbq92qzjwL45mYVlHhlLj7hvsFHvQSMwTraG1siT/4ZulPeeIrb DJuQ9ElWvoPKr7kZAwXLMI4EXPWuoFO1qatkWswlJcmsoElL793DSucjEZCyKFEseHTj jIkPNDl9uNTCC5gyjflNqDCrRR7S+gFaYZEvQptKX85mV/wz/idyuJs4p6baWd7HQQ7q lwSs62yPa2gNfPdBDe0qocWglETApmCasMWWs1txANStRQLBL/HM8SrXuwxsUGAALUME lQ6A== X-Gm-Message-State: APjAAAWxWpk/YqVn8E4rdM6DCLEpDb0R7uW7REhTD7uUeBAarYHjCpW6 /u0iulw2vROWq39NdBjAmzQPOVm0Rlh31g== X-Received: by 2002:aa7:8098:: with SMTP id v24mr11700214pff.33.1581843267503; Sun, 16 Feb 2020 00:54:27 -0800 (PST) Received: from localhost ([101.127.140.252]) by smtp.gmail.com with ESMTPSA id g2sm13183462pgn.59.2020.02.16.00.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 00:54:26 -0800 (PST) From: Jason Zaman To: selinux-refpolicy@vger.kernel.org Cc: Jason Zaman , Jason Zaman Subject: [PATCH 01/10] fstools: add zfs-auto-snapshot Date: Sun, 16 Feb 2020 16:54:13 +0800 Message-Id: <20200216085422.36530-1-jason@perfinion.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org Should be in domain fstools_t, and needs to run zpool which is mount_exec_t. type=AVC msg=audit(1563084061.269:2472): avc: denied { execute } for pid=4981 comm="env" name="zpool" dev="zfs" ino=259064 scontext=system_u:system_r:fsadm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:mount_exec_t:s0 tclass=file permissive=0 type=SYSCALL msg=audit(1563084061.269:2472): arch=c000003e syscall=59 success=no exit=-13 a0=7ffeba786e70 a1=7ffeba787098 a2=55726a69a4e0 a3=7fbff7eb5b00 items=1 ppid=4980 pid=4981 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="env" exe="/bin/env" subj=system_u:system_r:fsadm_t:s0-s0:c0.c1023 key=(null) type=CWD msg=audit(1563084061.269:2472): cwd="/root" type=PATH msg=audit(1563084061.269:2472): item=0 name="/sbin/zpool" inode=259064 dev=00:17 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:mount_exec_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Signed-off-by: Jason Zaman Signed-off-by: Jason Zaman --- policy/modules/system/fstools.fc | 1 + policy/modules/system/fstools.te | 2 ++ 2 files changed, 3 insertions(+) diff --git a/policy/modules/system/fstools.fc b/policy/modules/system/fstools.fc index 8fbd5ce4..d871294e 100644 --- a/policy/modules/system/fstools.fc +++ b/policy/modules/system/fstools.fc @@ -49,6 +49,7 @@ /usr/bin/swapon.* -- gen_context(system_u:object_r:fsadm_exec_t,s0) /usr/bin/tune2fs -- gen_context(system_u:object_r:fsadm_exec_t,s0) /usr/bin/zdb -- gen_context(system_u:object_r:fsadm_exec_t,s0) +/usr/bin/zfs-auto-snapshot -- gen_context(system_u:object_r:fsadm_exec_t,s0) /usr/bin/zhack -- gen_context(system_u:object_r:fsadm_exec_t,s0) /usr/bin/zinject -- gen_context(system_u:object_r:fsadm_exec_t,s0) /usr/bin/zpios -- gen_context(system_u:object_r:fsadm_exec_t,s0) diff --git a/policy/modules/system/fstools.te b/policy/modules/system/fstools.te index 4ad6e65f..4ae0301a 100644 --- a/policy/modules/system/fstools.te +++ b/policy/modules/system/fstools.te @@ -154,6 +154,8 @@ logging_send_syslog_msg(fsadm_t) miscfiles_read_localization(fsadm_t) +# for zfs/zpool +mount_exec(fsadm_t) # for /run/mount/utab mount_getattr_runtime_files(fsadm_t) # losetup: bind mount_loopback_t files to loop devices -- 2.24.1