加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Allow-smbcontrol-use-additional-socket-types.patch 2.09 KB
一键复制 编辑 原始数据 按行查看 历史
lujie54 提交于 2022-09-02 15:54 . backport upstream patches
From 0269eebb529eef5288b4b6dd1c62604dbd230230 Mon Sep 17 00:00:00 2001
From: Zdenek Pytela <zpytela@redhat.com>
Date: Tue, 23 Nov 2021 14:32:54 +0100
Subject: [PATCH] Allow smbcontrol use additional socket types
Reference: https://gitbub.com/fedora-selinux/selinux-policy/commit/0269eebb529eef5288b4b6dd1c62604dbd230230
Conflict: NA
In order to set debug level, smbcontrol was allowed to:
- create and use udp socket
- create and use netlink route sockets, read route configuration state
AVC denials example:
type=PROCTITLE msg=audit(11/23/2021 08:19:05.790:553) : proctitle=smbcontrol all debug 100
type=SYSCALL msg=audit(11/23/2021 08:19:05.790:553) : arch=x86_64 syscall=socket success=no exit=EACCES(Permission denied) a0=netlink a1=SOCK_RAW a2=ip a3=0x7fbb520a88b8 items=0 ppid=1060 pid=2372 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=3 comm=smbcontrol exe=/usr/bin/smbcontrol subj=unconfined_u:unconfined_r:smbcontrol_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(11/23/2021 08:19:05.790:553) : avc: denied { create } for pid=2372 comm=smbcontrol scontext=unconfined_u:unconfined_r:smbcontrol_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:smbcontrol_t:s0-s0:c0.c1023 tclass=netlink_route_socket permissive=0
Resolves: rhbz#2025931
Signed-off-by: lujie54 <lujie54@huawei.com>
---
policy/modules/contrib/samba.te | 2 ++
1 file changed, 2 insertions(+)
diff --git a/policy/modules/contrib/samba.te b/policy/modules/contrib/samba.te
index 72322f5..cb89bcf 100644
--- a/policy/modules/contrib/samba.te
+++ b/policy/modules/contrib/samba.te
@@ -718,6 +718,8 @@ allow smbcontrol_t self:capability2 block_suspend;
allow smbcontrol_t self:process { signal signull };
# internal communication is often done using fifo and unix sockets.
allow smbcontrol_t self:fifo_file rw_file_perms;
+allow smbcontrol_t self:netlink_route_socket r_netlink_socket_perms;
+allow smbcontrol_t self:udp_socket create_socket_perms;
allow smbcontrol_t self:unix_stream_socket create_stream_socket_perms;
allow smbcontrol_t self:unix_dgram_socket create_socket_perms;
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化