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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 D2202C2D0CF for ; Tue, 24 Dec 2019 10:11:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3B8B20643 for ; Tue, 24 Dec 2019 10:11:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=perfinion-com.20150623.gappssmtp.com header.i=@perfinion-com.20150623.gappssmtp.com header.b="sTqf2ZqK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726237AbfLXKLN (ORCPT ); Tue, 24 Dec 2019 05:11:13 -0500 Received: from mail-pj1-f52.google.com ([209.85.216.52]:39615 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbfLXKLN (ORCPT ); Tue, 24 Dec 2019 05:11:13 -0500 Received: by mail-pj1-f52.google.com with SMTP id t101so1021963pjb.4 for ; Tue, 24 Dec 2019 02:11:13 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=NbfdEmeHMjcEoTn1+hfvXxc02YhNXCiBk5m7KW4Bd6k=; b=sTqf2ZqK+7mk/muyjjOsRpSWhbm1Kc/feGwQKNLwGDsyOr4kLAzHvZGETaAovAZbHp r2xZLUyyGvFpI2o86x5IMQvmXM/BIePHj+AFMozcVm5h8dyqCdtGhbulf8SsAHqUUvLK ITig2xOZoOHfF7h3zT515EBkdTpc+NHiWRBkPMLG+2v+HmEWSbgGIR9sTvd2WzLuo+S3 MOrGv7UfezxJZtAYyPYfdYsqdP0QJOfXUc9oSbrjHXvolY9GhO8tMsONTVTsTf8VafAH 6PSGuVSg8cFrOh+H5SkwKaj+DHwfkdXQb4aNz/yi09LO/2QSCGcradLxiudbHJI4GnLI ubvw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NbfdEmeHMjcEoTn1+hfvXxc02YhNXCiBk5m7KW4Bd6k=; b=ewFzbqD+Rc0us/HSarynQ4kDGhR7BS6XwYJzaJfg+IrW97zUONwXYW2fzLhP4owdE+ EGl7xOCPdkiCOeF2DSFRsE8CmXp967GLqhOY7ggg030rStsksFHoBjj70WWNBDNHVyAM tlLWVR6BPyELl+OovTm65QFy4fRnBHh3ts3e5vQsYC4ZiECBWt8i8femJFWIG2YT/+5Q ccWq4h3x+jilsT78rMxPWdeL0MVNeMr7rRNwqx/k7Mm/kWXRGUlY6RpebFTGvO2ewllZ vZGaSC+qHvuuMTf1W1iaCWv9ZDfNUzU8WL8+Cjsd6txuGZ8gICEpMBM3Gg3oVTwDu39y VWWg== X-Gm-Message-State: APjAAAWgpJP2oTFlfmAyjUX3NCjtnDtYTkPEVGdndtGOG2VrBZIYiuj5 /3i/wkAndJq6uR9eNRgi9gNXDKhQRocMeA== X-Google-Smtp-Source: APXvYqwEllpaOUdvNrkE16srJNT+/nwK3u3jASxirzvx5Yu0Oe7F2BxUoq5ob1NfX0RutY5lUyEgbA== X-Received: by 2002:a17:902:850a:: with SMTP id bj10mr9709657plb.317.1577182272411; Tue, 24 Dec 2019 02:11:12 -0800 (PST) Received: from localhost ([101.127.140.252]) by smtp.gmail.com with ESMTPSA id k16sm2756037pje.18.2019.12.24.02.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2019 02:11:11 -0800 (PST) From: Jason Zaman To: selinux-refpolicy@vger.kernel.org Cc: Jason Zaman Subject: [PATCH 6/9] fstools: add zfs-auto-snapshot Date: Tue, 24 Dec 2019 18:10:40 +0800 Message-Id: <20191224101043.58122-6-jason@perfinion.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191224101043.58122-1-jason@perfinion.com> References: <20191224101043.58122-1-jason@perfinion.com> 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 --- policy/modules/system/fstools.fc | 1 + policy/modules/system/fstools.te | 1 + 2 files changed, 2 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 8d37e323..64b61485 100644 --- a/policy/modules/system/fstools.te +++ b/policy/modules/system/fstools.te @@ -154,6 +154,7 @@ logging_send_syslog_msg(fsadm_t) miscfiles_read_localization(fsadm_t) +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