Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4035428ybv; Sun, 16 Feb 2020 12:04:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzZozE4NEiE+kE79JuJT+X0RYGifH1V48o/f4MIbEVjnB73yDRqUKGDxqOECHS/MPrteoPF X-Received: by 2002:aca:ebcb:: with SMTP id j194mr8129499oih.154.1581883445832; Sun, 16 Feb 2020 12:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581883445; cv=none; d=google.com; s=arc-20160816; b=RLUxVTjpumzNtjoAQ9FiPqVMHtLJdp67ypMIlfdYITEqRkWzDrx8fwFFskOUeYsBCg rhNgpdSxsqqbspMaiR3CeBO+hgPnopjToFLHLGW7xzfS6OTIWtLot+BxB7V0eR/hPNKj Dl9i3WlctWtcWTjPMfuVdxf+zUE4jbEBPXGkvJeA6mwmEXz1weH2vmxA0+w15iG3k/D3 dwQkXANfILg1Jzme8eu9obeSkmtQBuW8AaH1F4zT8sxpJpXbBXr6ivjuqWHe8xvjvDlK Ua5Fi4Jfs6u+8mWjsKEgbjHp7GvLYbK6WgxMoizJLS+ZMAT1FYCVCJOa2906ZrCI8IM+ sEEw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+yj+qCrqJqgRXvLp5AHaswTvegt0FlM2GbsfbjcdUBA=; b=Te1Cp0uxadwRuLgQguq0K7Gp7je4vOGTpD/1mRGoDa5bBMctUYBBtumhriSxF9RSUv 7Z45lmeupnkQfPO5AXyaSyuWhJjD+HhOWY/isuoY0lsCYBAKZdJOgjU9mrMIhrB6xIyu iXWMihLHUCMjFwmtnukLOV47nI3SH16bwY+HI4jvfrakB8jwqSa63Nusbs1sT/Guxa+c hbX/bqZGn+xhSnJiz2YXq+oKuhQ6vUzdf7dguT/j7tXgSdFgApcpDkLp5y/mIYOnK7WD jfx/ifycQu2XBhp5uzsXSAugRDvp9wmgNDdNiXruU63JK+6rSw4aR9K/Gsg8NnBILfAZ P5VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perfinion-com.20150623.gappssmtp.com header.s=20150623 header.b="xhELEHt/"; 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 s22si5287396oij.35.2020.02.16.12.04.03; Sun, 16 Feb 2020 12:04:05 -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="xhELEHt/"; 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 S1726020AbgBPUED (ORCPT + 13 others); Sun, 16 Feb 2020 15:04:03 -0500 Received: from mail-pf1-f169.google.com ([209.85.210.169]:32901 "EHLO mail-pf1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbgBPUED (ORCPT ); Sun, 16 Feb 2020 15:04:03 -0500 Received: by mail-pf1-f169.google.com with SMTP id n7so7726907pfn.0 for ; Sun, 16 Feb 2020 12:04:01 -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=+yj+qCrqJqgRXvLp5AHaswTvegt0FlM2GbsfbjcdUBA=; b=xhELEHt/swYNb9gydbSniBUB76aPkZS5lbZDyyFuNfgZuukSewWOy/QQ37vorIfmeV OWC6zBy2l8nr2ICSi8NiGR+y4ulTbhDhMDlTZmk+WiXwMdd9+H1oWSWUEKtCuNrhviri yzP51MqrD658KBS2BOhWveJkF/kpIBCiAWfIu0iAP/ljTh/K30hhiVLBVGn3OSdJ+0Z4 +4p0RN4tF7bRShU/or47ULSB+PsfCM2Ci5SUCxdmpXjyGFB+bqJ8keff+dAF6wWN6nqY TemdUzyrfmQYNdlE1raiPDVXqeb77SDkeNly7+/e7kQGxJhukdFQ8FYa5EptPPI9Y3MA MciQ== 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=+yj+qCrqJqgRXvLp5AHaswTvegt0FlM2GbsfbjcdUBA=; b=e2clurI0UlT/lIX6MihtM4HDR1ESS2l8JuDnGVnYLLaJude+B0qPhDkZ3IXkStNOAy GVVeK72V4E/Dy9SGFxGu4+tNUuGAV/pNR5i3KtajTNWvuZ5kmbTxkZATWolIcJQMNko+ 54X6Y5EeCKC5/BAIFzXxKZ6lggv6k/wJbT6d0+U88y2c0e4DTJ8S4YPDOViJD7Z4HAh5 G06ai3rr7cz9PJyrSsjDQnj18HRAbv7UDqbQFBdUrZ9k6UQWQqJ7zD6TmeWtbBIsDS38 Y3Mjm51B0bu2ClILX55yCD54xlXCCjhFW3p31XuuQX8BhIaMxhbJ4gSvihftqcsUP2xx jYAQ== X-Gm-Message-State: APjAAAXRlZLbp4uliVwTNjTrOfFGkIPCmHxmn2FrTEpr2GxY26J43krM 6HiQR5FgMyG4XDerTMjUDbkgYnWRBCs= X-Received: by 2002:a63:6407:: with SMTP id y7mr14319275pgb.45.1581883441053; Sun, 16 Feb 2020 12:04:01 -0800 (PST) Received: from localhost ([101.127.140.252]) by smtp.gmail.com with ESMTPSA id s5sm15021657pgc.73.2020.02.16.12.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 12:04:00 -0800 (PST) From: Jason Zaman To: selinux-refpolicy@vger.kernel.org Cc: Jason Zaman Subject: [PATCH 06/10] policykit devicekit: Add watch perms Date: Mon, 17 Feb 2020 04:03:15 +0800 Message-Id: <20200216200319.39337-6-jason@perfinion.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200216200319.39337-1-jason@perfinion.com> References: <20200216200319.39337-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 avc: denied { watch } for pid=12488 comm="gmain" path="/etc" dev="zfs" ino=1436 scontext=system_u:system_r:devicekit_disk_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=0 avc: denied { watch } for pid=6452 comm="gmain" path="/run/ConsoleKit" dev="tmpfs" ino=17611 scontext=system_u:system_r:policykit_t:s0-s0:c0.c1023 tcontext=system_u:object_r:consolekit_runtime_t:s0 tclass=dir permissive=0 avc: denied { watch } for pid=6452 comm="gmain" path="/usr/share/polkit-1/actions" dev="zfs" ino=235638 scontext=system_u:system_r:policykit_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usr_t:s0 tclass=dir permissive=0 avc: denied { watch } for pid=6452 comm="gmain" path="/etc/polkit-1/rules.d" dev="zfs" ino=268215 scontext=system_u:system_r:policykit_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=0 Signed-off-by: Jason Zaman --- policy/modules/services/consolekit.if | 18 ++++++++++++++++++ policy/modules/services/devicekit.te | 1 + policy/modules/services/policykit.te | 3 +++ 3 files changed, 22 insertions(+) diff --git a/policy/modules/services/consolekit.if b/policy/modules/services/consolekit.if index 9aa0dbce..422c19cd 100644 --- a/policy/modules/services/consolekit.if +++ b/policy/modules/services/consolekit.if @@ -121,3 +121,21 @@ interface(`consolekit_read_pid_files',` allow $1 consolekit_runtime_t:dir list_dir_perms; read_files_pattern($1, consolekit_runtime_t, consolekit_runtime_t) ') + +######################################## +## +## Watch consolekit runtime dir. +## +## +## +## Domain allowed access. +## +## +# +interface(`consolekit_watch_runtime_dir',` + gen_require(` + type consolekit_runtime_t; + ') + + allow $1 consolekit_runtime_t:dir watch; +') diff --git a/policy/modules/services/devicekit.te b/policy/modules/services/devicekit.te index f58a7a19..ed88f10b 100644 --- a/policy/modules/services/devicekit.te +++ b/policy/modules/services/devicekit.te @@ -127,6 +127,7 @@ files_manage_boot_dirs(devicekit_disk_t) files_manage_mnt_dirs(devicekit_disk_t) files_read_etc_runtime_files(devicekit_disk_t) files_read_usr_files(devicekit_disk_t) +files_watch_etc_dirs(devicekit_disk_t) fs_getattr_all_fs(devicekit_disk_t) fs_list_inotifyfs(devicekit_disk_t) diff --git a/policy/modules/services/policykit.te b/policy/modules/services/policykit.te index 04e88500..4989157c 100644 --- a/policy/modules/services/policykit.te +++ b/policy/modules/services/policykit.te @@ -95,6 +95,8 @@ dev_read_urand(policykit_t) domain_read_all_domains_state(policykit_t) files_dontaudit_search_all_mountpoints(policykit_t) +files_watch_etc_dirs(policykit_t) +files_watch_usr_dirs(policykit_t) fs_getattr_xattr_fs(policykit_t) fs_list_inotifyfs(policykit_t) @@ -127,6 +129,7 @@ optional_policy(` optional_policy(` consolekit_read_pid_files(policykit_t) + consolekit_watch_runtime_dir(policykit_t) ') optional_policy(` -- 2.24.1