0 Star 0 Fork 31

lixiao/selinux-policy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Allow-systemd-io-bridge-ioctl-rpm_script_t.patch 2.51 KB
一键复制 编辑 原始数据 按行查看 历史
lujie54 提交于 2022-09-13 19:52 . update upstream patches
From 3ecf12ffdad26ee5c6361a7c1e82ba507abdc04f Mon Sep 17 00:00:00 2001
From: Zdenek Pytela <zpytela@redhat.com>
Date: Thu, 13 Jan 2022 22:12:03 +0100
Subject: [PATCH] Allow systemd-io-bridge ioctl rpm_script_t
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reference: https://gitbub.com/fedora-selinux/selinux-policy/commit/3ecf12ffdad26ee5c6361a7c1e82ba507abdc04f
Conflict: NA
The permission to allow systemd-io-bridge ioctl rpm_script_t
with a unix domain stream socket was added to the policy.
It may be required when rpm packages are updated.
Addresses the following AVC denial:
type=PROCTITLE msg=audit(3.1.2022 01:17:50.921:486) : proctitle=(o-bridge)
type=SYSCALL msg=audit(3.1.2022 01:17:50.921:486) : arch=x86_64 syscall=ioctl success=no exit=ENOTTY(Pro toto zařízení nevhodné ioctl) a0=0x0 a1=TCGETS a2=0x7ffe8195d1e0 a3=0x7f9ea8a35ca0 items=0 ppid=1 pid=2846 auid=sddm uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=4 comm=(o-bridge) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=(null)
type=AVC msg=audit(3.1.2022 01:17:50.921:486) : avc: denied { ioctl } for pid=2846 comm=(o-bridge) path=socket:[43260] dev="sockfs" ino=43260 ioctlcmd=TCGETS scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:unconfined_r:rpm_script_t:s0-s0:c0.c1023 tclass=unix_stream_socket permissive=1
Resolves: rhbz#2024489
Signed-off-by: lujie54 <lujie54@huawei.com>
---
policy/modules/contrib/rpm.if | 18 ++++++++++++++++++
policy/modules/system/init.te | 1 +
2 files changed, 19 insertions(+)
diff --git a/policy/modules/contrib/rpm.if b/policy/modules/contrib/rpm.if
index db809c6..190f3e2 100644
--- a/policy/modules/contrib/rpm.if
+++ b/policy/modules/contrib/rpm.if
@@ -957,3 +957,21 @@ interface(`rpm_admin',`
rpm_run($1, $2)
')
+
+## <summary>
+## Allow the specified domain to ioctl rpm_script_t
+## with a unix domain stream socket.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`rpm_script_ioctl_stream_sockets',`
+ gen_require(`
+ type rpm_script_t;
+ ')
+
+ allow $1 rpm_script_t:unix_stream_socket ioctl;
+')
diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
index 0de5f4a..a81f5da 100644
--- a/policy/modules/system/init.te
+++ b/policy/modules/system/init.te
@@ -516,6 +516,7 @@ optional_policy(`
optional_policy(`
rpm_read_db(init_t)
+ rpm_script_ioctl_stream_sockets(init_t)
')
optional_policy(`
--
1.8.3.1
马建仓 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