summaryrefslogtreecommitdiffstats
path: root/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-systemd-make-systemd_-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-systemd-make-systemd_-.patch')
-rw-r--r--recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-systemd-make-systemd_-.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-systemd-make-systemd_-.patch b/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-systemd-make-systemd_-.patch
new file mode 100644
index 0000000..e3d5db1
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-systemd-make-systemd_-.patch
@@ -0,0 +1,91 @@
1From 4eaa766ef11cb053f010bcde5121e76031aae799 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jun 2020 09:59:58 +0800
4Subject: [PATCH] policy/modules/system/systemd: systemd-*: make systemd_*_t
5 MLS trusted for writing/reading from files up to its clearance
6
7Fixes:
8audit: type=1400 audit(1592892455.376:3): avc: denied { write } for
9pid=120 comm="systemd-gpt-aut" name="kmsg" dev="devtmpfs" ino=10032
10scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
12permissive=0
13
14audit: type=1400 audit(1592892455.381:4): avc: denied { write } for
15pid=119 comm="systemd-getty-g" name="kmsg" dev="devtmpfs" ino=10032
16scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
17tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
18permissive=0
19
20avc: denied { read } for pid=125 comm="systemd-gpt-aut" name="sdb"
21dev="devtmpfs" ino=42
22scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
23tcontext=system_u:object_r:fixed_disk_device_t:s15:c0.c1023
24tclass=blk_file permissive=0
25
26avc: denied { write } for pid=233 comm="systemd-rfkill" name="kmsg"
27dev="devtmpfs" ino=2060
28scontext=system_u:system_r:systemd_rfkill_t:s0-s15:c0.c1023
29tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
30permissive=0
31
32avc: denied { write } for pid=354 comm="systemd-backlig" name="kmsg"
33dev="devtmpfs" ino=3081
34scontext=system_u:system_r:systemd_backlight_t:s0-s15:c0.c1023
35tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
36permissive=0
37
38Upstream-Status: Inappropriate [embedded specific]
39
40Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
41---
42 policy/modules/system/systemd.te | 12 ++++++++++++
43 1 file changed, 12 insertions(+)
44
45diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
46index e483d8aea..a0e6bb405 100644
47--- a/policy/modules/system/systemd.te
48+++ b/policy/modules/system/systemd.te
49@@ -391,6 +391,9 @@ files_search_var_lib(systemd_backlight_t)
50 fs_getattr_all_fs(systemd_backlight_t)
51 fs_search_cgroup_dirs(systemd_backlight_t)
52
53+mls_file_read_to_clearance(systemd_backlight_t)
54+mls_file_write_to_clearance(systemd_backlight_t)
55+
56 #######################################
57 #
58 # Binfmt local policy
59@@ -560,6 +563,9 @@ term_use_unallocated_ttys(systemd_generator_t)
60
61 udev_read_runtime_files(systemd_generator_t)
62
63+mls_file_read_to_clearance(systemd_generator_t)
64+mls_file_write_to_clearance(systemd_generator_t)
65+
66 ifdef(`distro_gentoo',`
67 corecmd_shell_entry_type(systemd_generator_t)
68 ')
69@@ -1009,6 +1015,9 @@ userdom_setattr_user_ttys(systemd_logind_t)
70 userdom_use_user_ttys(systemd_logind_t)
71 domain_read_all_domains_state(systemd_logind_t)
72
73+mls_file_read_all_levels(systemd_logind_t)
74+mls_file_write_all_levels(systemd_logind_t)
75+
76 # Needed to work around patch not yet merged into the systemd-logind supported on RHEL 7.x
77 # The change in systemd by Nicolas Iooss on 02-Feb-2016 with hash 4b51966cf6c06250036e428608da92f8640beb96
78 # should fix the problem where user directories in /run/user/$UID/ are not getting the proper context
79@@ -1591,6 +1600,9 @@ udev_read_runtime_files(systemd_rfkill_t)
80
81 systemd_log_parse_environment(systemd_rfkill_t)
82
83+mls_file_read_to_clearance(systemd_rfkill_t)
84+mls_file_write_to_clearance(systemd_rfkill_t)
85+
86 #########################################
87 #
88 # Resolved local policy
89--
902.25.1
91