0 Star 0 Fork 31

lixiao/selinux-policy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Allow-systemd-gpt-auto-generator-to-check-for-empty-.patch 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
lujie42 提交于 2022-11-27 22:53 . update upstream patches
From 8304d9b80b3cb22e429d2113cf81dca07d306dd7 Mon Sep 17 00:00:00 2001
From: Quintin Hill <stuff@quintin.me.uk>
Date: Fri, 2 Sep 2022 16:44:37 +0100
Subject: [PATCH] Allow systemd-gpt-auto-generator to check for empty dirs
systemd-gpt-auto-generator wants to check that certain subdirectories of / are empty before generating mount units for them this is not permitted by policy.
Addresses:
systemd-gpt-auto-generator[388]: Cannot check if "/home" is empty: Permission denied
kernel: audit: type=1400 audit(1662118200.418:80): avc: denied { read } for pid=388 comm="systemd-gpt-aut" name="home" dev="sda2" ino=3180 scontext=system_u:system_r:systemd_gpt_generator_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir permissive=0
audit[388]: AVC avc: denied { read } for pid=388 comm="systemd-gpt-aut" name="var" dev="sda2" ino=362569 scontext=system_u:system_r:systemd_gpt_generator_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir permissive=0
systemd-gpt-auto-generator[388]: Cannot check if "/var" is empty: Permission denied
Resolves: rhbz#2123765
Signed-off-by: lujie42 <lujie54@huawei.com>
---
policy/modules/system/systemd.te | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
index a9308b8cc..028820491 100644
--- a/policy/modules/system/systemd.te
+++ b/policy/modules/system/systemd.te
@@ -1112,6 +1112,11 @@ dev_read_sysfs(systemd_gpt_generator_t)
dev_write_kmsg(systemd_gpt_generator_t)
dev_read_rand(systemd_gpt_generator_t)
+files_list_boot(systemd_gpt_generator_t)
+files_list_home(systemd_gpt_generator_t)
+files_list_tmp(systemd_gpt_generator_t)
+files_list_usr(systemd_gpt_generator_t)
+files_list_var(systemd_gpt_generator_t)
fstools_exec(systemd_gpt_generator_t)
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lixiao2023/selinux-policy.git
git@gitee.com:lixiao2023/selinux-policy.git
lixiao2023
selinux-policy
selinux-policy
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385