From mboxrd@z Thu Jan 1 00:00:00 1970 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 3B8CBC3B1BF for ; Sun, 16 Feb 2020 20:03:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06DD12084E for ; Sun, 16 Feb 2020 20:03:33 +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="M410GY8/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726020AbgBPUDc (ORCPT ); Sun, 16 Feb 2020 15:03:32 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38331 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbgBPUDc (ORCPT ); Sun, 16 Feb 2020 15:03:32 -0500 Received: by mail-pl1-f193.google.com with SMTP id t6so5845664plj.5 for ; Sun, 16 Feb 2020 12:03:32 -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=M410GY8/JMurPU0ohuZxBSk9QsIxOhCXmHPFROiZSr4d49qTYcQSzeb7kwbaoeikPJ sku4NDv9YXz/oVDS9fO7d6crWslY3p8DkTts7MKtEx+UEH7/rbE82EKGgbiEliUAew3t JAcDmhr3zlemIbZSEOSzZOhjTGfzBI0maI78qy+LYf7W6FEADfFzlgmhYlWAAnFBpjoj oonAybbrTN1we9bPclECXx155BkuXnej73kbeJswL5XsdFt5YiBmOFJZCwOZoQ1augM9 KnTXtfEdZvKhtFogLzrLFeWaYnkVCOa6WkevPuOh4XB9hK8bU+B/qt4jnNiO0WGd1hI6 lqQw== 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=ajvMONspscEkFaJHYsL0CAJwLtI67iJy5Dpfd5V3j281vqVVwz6W01IRjFfsjnctCl YABL1ApG7cuv/I1eRmLF5O4Yv2+FUt/LsApAv5t+SsMqMatHvroAdeRkomZWJfZnG9XJ vfpSTMjQTKihKn0ofivsPZQS2s0zuwVlcmiNxvZL3Vy3ziWpDoUb0bS3os4NQHhSx2pi JsgoiVunL1tHjRo8OECS4Hfb9fwCKOKmVjkEUXo7bShU3i7/BhNucd7M/bhfr5N1Ihd+ LCZWq7R843oTKhU7T8mykkIqi5+IuPIERxDPwZ6ogrMPAhGBktzvtO9cKRVr23ttaOFX OS4w== X-Gm-Message-State: APjAAAXwcxN8rGMdsoTi039531NL45u6ay8i8Gpx958H2MV5qG1N4FSS CH7qR6ZTmjLThpmQcCX1EtYSooPzgt4= X-Google-Smtp-Source: APXvYqyQAErLFLJovGc1IUADt8Pp9iG1QAxtSdpHqp+INCGkOdj5IeeeNFUG2OfqTFub9t1rpFX6MA== X-Received: by 2002:a17:90a:cb8c:: with SMTP id a12mr16440093pju.71.1581883411417; Sun, 16 Feb 2020 12:03:31 -0800 (PST) Received: from localhost ([101.127.140.252]) by smtp.gmail.com with ESMTPSA id i64sm14443193pgc.51.2020.02.16.12.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 12:03:30 -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: Mon, 17 Feb 2020 04:03:10 +0800 Message-Id: <20200216200319.39337-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