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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 87144158094 for ; Sat, 3 Sep 2022 19:10:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2B44DE07E0; Sat, 3 Sep 2022 19:10:20 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0D027E07E0 for ; Sat, 3 Sep 2022 19:10:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EC5E4340F80 for ; Sat, 3 Sep 2022 19:10:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F05FC5C0 for ; Sat, 3 Sep 2022 19:10:15 +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: <1662230515.888c1aed22a0f67d4e4bdac540f249c392f27cec.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/init.if policy/modules/system/systemd.fc policy/modules/system/systemd.if X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 888c1aed22a0f67d4e4bdac540f249c392f27cec X-VCS-Branch: master Date: Sat, 3 Sep 2022 19:10:15 +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: 20037053-be9d-4583-90c1-882c9db989b1 X-Archives-Hash: cbd43ba1598e0723f36f89b23fd4ca91 commit: 888c1aed22a0f67d4e4bdac540f249c392f27cec Author: Kenton Groombridge concord sh> AuthorDate: Sat Apr 2 19:40:07 2022 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Sep 3 18:41:55 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=888c1aed init, systemd: allow unpriv users to read the catalog Label /var/lib/systemd/catalog the journal type, and allow unpriv users to search /var/lib/systemd. This is to fix this warning when an unprivileged user uses journalctl: Failed to find catalog entry: Permission denied Signed-off-by: Kenton Groombridge concord.sh> Signed-off-by: Jason Zaman gentoo.org> policy/modules/system/init.if | 19 +++++++++++++++++++ policy/modules/system/systemd.fc | 2 ++ policy/modules/system/systemd.if | 1 + 3 files changed, 22 insertions(+) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 8d3eab4a..1ce483da 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -1375,6 +1375,25 @@ interface(`init_read_var_lib_links',` allow $1 init_var_lib_t:lnk_file read_lnk_file_perms; ') +######################################## +## +## Search /var/lib/systemd/ dirs +## +## +## +## Domain allowed access. +## +## +# +interface(`init_search_var_lib_dirs',` + gen_require(` + type init_var_lib_t; + ') + + files_search_var_lib($1) + allow $1 init_var_lib_t:dir search_dir_perms; +') + ######################################## ## ## List /var/lib/systemd/ dir diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index 2cbc2e19..cf7ce0c4 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -75,6 +75,8 @@ HOME_DIR/\.local/share/systemd(/.*)? gen_context(system_u:object_r:systemd_data /var/\.updated -- gen_context(system_u:object_r:systemd_update_run_t,s0) +/var/lib/systemd/catalog(/.*)? gen_context(system_u:object_r:systemd_journal_t,s0) + /var/lib/systemd/backlight(/.*)? gen_context(system_u:object_r:systemd_backlight_var_lib_t,s0) /var/lib/systemd/coredump(/.*)? gen_context(system_u:object_r:systemd_coredump_var_lib_t,s0) /var/lib/systemd/home(/.*)? gen_context(system_u:object_r:systemd_homed_var_lib_t,s0) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index c2b6824b..1da951f0 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -160,6 +160,7 @@ template(`systemd_role_template',` can_exec($3, { systemd_run_exec_t systemd_analyze_exec_t }) init_dbus_chat($3) + init_search_var_lib_dirs($3) systemd_list_journal_dirs($3) systemd_read_journal_files($3)