Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4035025ybv; Sun, 16 Feb 2020 12:03:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzr7Y4tCf88TnvVAq+77iLfdkTj1ISKfTaZwqcaOZo887Mri9ZPgoSTSy7sgy7sj03WMmMT X-Received: by 2002:a05:6808:218:: with SMTP id l24mr7638543oie.108.1581883417499; Sun, 16 Feb 2020 12:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581883417; cv=none; d=google.com; s=arc-20160816; b=VFdvR5y7T7iPly0cI9QYumsgOjA1cRz/nqA50gxtGoIeSoUCpXzB/0hADmwBrpsuI+ IQ0UbCmFlvV+5vpC1zao4C/eDG3PsK34BxB6TpJt6jiZPVFk4cA5qI2tx4PhsSW/sPa5 29RugpquGdYUv32jT5Hu/16JVknoB0panM6v19OBGTJA8AceRY3f8yC8SXqd0enQQd0q TRg8UI3Agxqx5nBDKwxICA11qWqLA+Qu1LlZzE0Dz8TXxwJseeKDrjPvPpWqakBSFZNF SUuLWXeh18zFb3+xMVkKuzjBwW54H15j1m6VEfp9RLHGtnRROXipvT1+aTDcyEm7+qGo zHog== 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=dPgKep5V6+W/S+hc5F7LOA2Q/cP+gbJSSxBbXjuiKXeGwRdsMwHe6wyO7Fm7NVZ5nD 5hoLumKaYqZaSBIR/DPUBGeOjbZrG8LtwkxlRSqq4bOStK7xhHdvxzldvS8GYVPk9zWd 8JLJoUyRb6yRxa1vtQYBEqXAMp0RKnwGR0U/IQXa9DOq0XFHKR/rO5OdbLJX3yWxcBEg j8WZtNwbi85TQg5KdfnMzJx9xO+dcefhJi2XRTfxWaDgniGywARekEW/kMvl25juhvZz +C73mHl7ZgArtr3rbRY8dp8JtXF6xQC77wSm2RZU9QpvtINdFeqQscJAXvbN0JJo40WD vVfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perfinion-com.20150623.gappssmtp.com header.s=20150623 header.b="M410GY8/"; 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 i9si6315843otp.139.2020.02.16.12.03.32; Sun, 16 Feb 2020 12:03: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="M410GY8/"; 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 S1726020AbgBPUDc (ORCPT + 13 others); 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-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