From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3FD54138334 for ; Tue, 26 Mar 2019 10:17:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9C01EE0896; Tue, 26 Mar 2019 10:17:38 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 71D46E0891 for ; Tue, 26 Mar 2019 10:17:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 56ED4335CF8 for ; Tue, 26 Mar 2019 10:17:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 27E02582 for ; Tue, 26 Mar 2019 10:17:34 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1553508325.68f0d31ccb685203e3146a4f10f80af9412fd160.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/system/systemd.if policy/modules/system/udev.te X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 68f0d31ccb685203e3146a4f10f80af9412fd160 X-VCS-Branch: master Date: Tue, 26 Mar 2019 10:17:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 44d207ba-8756-4742-8287-48f8b97efd98 X-Archives-Hash: 47472642c7a7a83e8e3f48329f6b50bc commit: 68f0d31ccb685203e3146a4f10f80af9412fd160 Author: Sugar, David tresys com> AuthorDate: Sat Mar 9 03:58:09 2019 +0000 Commit: Jason Zaman gentoo org> CommitDate: Mon Mar 25 10:05:25 2019 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=68f0d31c Allow additional map permission when reading hwdb I'm seeing a denial for udev to map /etc/udev/hwdb.bin. This creates and uses a new interface to allow the needed permission for udev. type=AVC msg=audit(1551886176.948:642): avc: denied { map } for pid=5187 comm="systemd-udevd" path="/etc/udev/hwdb.bin" dev="dm-1" ino=6509618 scontext=system_u:system_r:udev_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_hwdb_t:s0 tclass=file permissive=1 Updated from previous to create a new interface. Signed-off-by: Dave Sugar tresys.com> Signed-off-by: Jason Zaman perfinion.com> policy/modules/system/systemd.if | 18 ++++++++++++++++++ policy/modules/system/udev.te | 1 + 2 files changed, 19 insertions(+) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index 8d2bb8da..6353ca69 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -37,6 +37,24 @@ interface(`systemd_read_hwdb',` read_files_pattern($1, systemd_hwdb_t, systemd_hwdb_t) ') +####################################### +## +## Allow domain to map udev hwdb file +## +## +## +## domain allowed access +## +## +# +interface(`systemd_map_hwdb',` + gen_require(` + type systemd_hwdb_t; + ') + + allow $1 systemd_hwdb_t:file map; +') + ###################################### ## ## Read systemd_login PID files. diff --git a/policy/modules/system/udev.te b/policy/modules/system/udev.te index 99f22bfb..f6a9d652 100644 --- a/policy/modules/system/udev.te +++ b/policy/modules/system/udev.te @@ -248,6 +248,7 @@ ifdef(`init_systemd',` init_get_generic_units_status(udev_t) init_stream_connect(udev_t) + systemd_map_hwdb(udev_t) systemd_read_hwdb(udev_t) systemd_read_logind_sessions_files(udev_t) systemd_read_logind_pids(udev_t)