summaryrefslogtreecommitdiffstats
path: root/recipes-security/refpolicy/refpolicy/0043-policy-modules-system-sysnetwork-support-priviledge-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/refpolicy/refpolicy/0043-policy-modules-system-sysnetwork-support-priviledge-.patch')
-rw-r--r--recipes-security/refpolicy/refpolicy/0043-policy-modules-system-sysnetwork-support-priviledge-.patch132
1 files changed, 132 insertions, 0 deletions
diff --git a/recipes-security/refpolicy/refpolicy/0043-policy-modules-system-sysnetwork-support-priviledge-.patch b/recipes-security/refpolicy/refpolicy/0043-policy-modules-system-sysnetwork-support-priviledge-.patch
new file mode 100644
index 0000000..504e028
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0043-policy-modules-system-sysnetwork-support-priviledge-.patch
@@ -0,0 +1,132 @@
1From d1c159d4400722e783d12cc3684c1cf15004f7a9 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 24 Sep 2020 14:05:52 +0800
4Subject: [PATCH] policy/modules/system/sysnetwork: support priviledge
5 separation for dhcpcd
6
7Fixes:
8
9avc: denied { sys_chroot } for pid=332 comm="dhcpcd" capability=18
10scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
11tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
12permissive=0
13
14avc: denied { setgid } for pid=332 comm="dhcpcd" capability=6
15scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
16tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
17permissive=0
18
19avc: denied { setuid } for pid=332 comm="dhcpcd" capability=7
20scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
21tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
22permissive=0
23
24avc: denied { setrlimit } for pid=332 comm="dhcpcd"
25scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
26tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=process
27permissive=0
28
29avc: denied { create } for pid=330 comm="dhcpcd"
30scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
31tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
32tclass=netlink_kobject_uevent_socket permissive=0
33
34avc: denied { setopt } for pid=330 comm="dhcpcd"
35scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
36tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
37tclass=netlink_kobject_uevent_socket permissive=0
38
39avc: denied { bind } for pid=330 comm="dhcpcd"
40scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
41tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
42tclass=netlink_kobject_uevent_socket permissive=0
43
44avc: denied { getattr } for pid=330 comm="dhcpcd"
45scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
46tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
47tclass=netlink_kobject_uevent_socket permissive=0
48
49avc: denied { read } for pid=330 comm="dhcpcd" name="n1" dev="tmpfs"
50ino=15616 scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
51tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
52
53avc: denied { open } for pid=330 comm="dhcpcd"
54path="/run/udev/data/n1" dev="tmpfs" ino=15616
55scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
56tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
57
58avc: denied { getattr } for pid=330 comm="dhcpcd"
59path="/run/udev/data/n1" dev="tmpfs" ino=15616
60scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
61tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
62
63avc: denied { connectto } for pid=1600 comm="dhcpcd"
64path="/run/dhcpcd/unpriv.sock"
65scontext=root:sysadm_r:dhcpc_t:s0-s15:c0.c1023
66tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
67tclass=unix_stream_socket permissive=0
68
69avc: denied { kill } for pid=314 comm="dhcpcd" capability=5
70scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
71tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
72permissive=0
73
74avc: denied { getattr } for pid=300 comm="dhcpcd"
75path="net:[4026532008]" dev="nsfs" ino=4026532008
76scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
77tcontext=system_u:object_r:nsfs_t:s0 tclass=file permissive=0
78
79Upstream-Status: Inappropriate [embedded specific]
80
81Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
82---
83 policy/modules/system/sysnetwork.te | 7 ++++++-
84 1 file changed, 6 insertions(+), 1 deletion(-)
85
86diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
87index 4c317cc4c..05a9a52b8 100644
88--- a/policy/modules/system/sysnetwork.te
89+++ b/policy/modules/system/sysnetwork.te
90@@ -58,10 +58,11 @@ ifdef(`distro_debian',`
91 # DHCP client local policy
92 #
93 allow dhcpc_t self:capability { dac_override fsetid net_admin net_bind_service net_raw setpcap sys_nice sys_resource sys_tty_config };
94+allow dhcpc_t self:capability { setgid setuid sys_chroot kill };
95 dontaudit dhcpc_t self:capability { sys_ptrace sys_tty_config };
96 # for access("/etc/bashrc", X_OK) on Red Hat
97 dontaudit dhcpc_t self:capability { dac_read_search sys_module };
98-allow dhcpc_t self:process { getsched getcap setcap setfscreate ptrace signal_perms };
99+allow dhcpc_t self:process { getsched getcap setcap setfscreate ptrace signal_perms setrlimit };
100
101 allow dhcpc_t self:fifo_file rw_fifo_file_perms;
102 allow dhcpc_t self:tcp_socket create_stream_socket_perms;
103@@ -69,8 +70,10 @@ allow dhcpc_t self:udp_socket create_socket_perms;
104 allow dhcpc_t self:packet_socket create_socket_perms;
105 allow dhcpc_t self:netlink_generic_socket create_socket_perms;
106 allow dhcpc_t self:netlink_route_socket create_netlink_socket_perms;
107+allow dhcpc_t self:netlink_kobject_uevent_socket create_socket_perms;
108 allow dhcpc_t self:rawip_socket create_socket_perms;
109 allow dhcpc_t self:unix_dgram_socket { create_socket_perms sendto };
110+allow dhcpc_t self:unix_stream_socket connectto;
111
112 allow dhcpc_t dhcp_etc_t:dir list_dir_perms;
113 read_lnk_files_pattern(dhcpc_t, dhcp_etc_t, dhcp_etc_t)
114@@ -146,6 +149,7 @@ files_manage_var_files(dhcpc_t)
115 fs_getattr_all_fs(dhcpc_t)
116 fs_search_auto_mountpoints(dhcpc_t)
117 fs_search_cgroup_dirs(dhcpc_t)
118+fs_read_nsfs_files(dhcpc_t)
119
120 term_dontaudit_use_all_ttys(dhcpc_t)
121 term_dontaudit_use_all_ptys(dhcpc_t)
122@@ -181,6 +185,7 @@ ifdef(`init_systemd',`
123 init_stream_connect(dhcpc_t)
124 init_get_all_units_status(dhcpc_t)
125 init_search_units(dhcpc_t)
126+ udev_read_runtime_files(dhcpc_t)
127 ')
128
129 optional_policy(`
130--
1312.17.1
132