diff options
Diffstat (limited to 'recipes-security/refpolicy/refpolicy/0046-policy-modules-system-systemd-systemd-make-systemd_-.patch')
-rw-r--r-- | recipes-security/refpolicy/refpolicy/0046-policy-modules-system-systemd-systemd-make-systemd_-.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/recipes-security/refpolicy/refpolicy/0046-policy-modules-system-systemd-systemd-make-systemd_-.patch b/recipes-security/refpolicy/refpolicy/0046-policy-modules-system-systemd-systemd-make-systemd_-.patch new file mode 100644 index 0000000..800439c --- /dev/null +++ b/recipes-security/refpolicy/refpolicy/0046-policy-modules-system-systemd-systemd-make-systemd_-.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 8aa70c13d63e093bff87ea938d35dcc76e5bdd56 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
3 | Date: Thu, 18 Jun 2020 09:59:58 +0800 | ||
4 | Subject: [PATCH] policy/modules/system/systemd: systemd-*: make systemd_*_t | ||
5 | MLS trusted for writing/reading from files up to its clearance | ||
6 | |||
7 | Fixes: | ||
8 | audit: type=1400 audit(1592892455.376:3): avc: denied { write } for | ||
9 | pid=120 comm="systemd-gpt-aut" name="kmsg" dev="devtmpfs" ino=10032 | ||
10 | scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023 | ||
11 | tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file | ||
12 | permissive=0 | ||
13 | |||
14 | audit: type=1400 audit(1592892455.381:4): avc: denied { write } for | ||
15 | pid=119 comm="systemd-getty-g" name="kmsg" dev="devtmpfs" ino=10032 | ||
16 | scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023 | ||
17 | tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file | ||
18 | permissive=0 | ||
19 | |||
20 | avc: denied { read } for pid=125 comm="systemd-gpt-aut" name="sdb" | ||
21 | dev="devtmpfs" ino=42 | ||
22 | scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023 | ||
23 | tcontext=system_u:object_r:fixed_disk_device_t:s15:c0.c1023 | ||
24 | tclass=blk_file permissive=0 | ||
25 | |||
26 | avc: denied { write } for pid=233 comm="systemd-rfkill" name="kmsg" | ||
27 | dev="devtmpfs" ino=2060 | ||
28 | scontext=system_u:system_r:systemd_rfkill_t:s0-s15:c0.c1023 | ||
29 | tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file | ||
30 | permissive=0 | ||
31 | |||
32 | avc: denied { write } for pid=354 comm="systemd-backlig" name="kmsg" | ||
33 | dev="devtmpfs" ino=3081 | ||
34 | scontext=system_u:system_r:systemd_backlight_t:s0-s15:c0.c1023 | ||
35 | tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file | ||
36 | permissive=0 | ||
37 | |||
38 | Upstream-Status: Inappropriate [embedded specific] | ||
39 | |||
40 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
41 | --- | ||
42 | policy/modules/system/systemd.te | 12 ++++++++++++ | ||
43 | 1 file changed, 12 insertions(+) | ||
44 | |||
45 | diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te | ||
46 | index b44b9b2d7..7b717d3ba 100644 | ||
47 | --- a/policy/modules/system/systemd.te | ||
48 | +++ b/policy/modules/system/systemd.te | ||
49 | @@ -373,6 +373,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 | @@ -528,6 +531,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 | @@ -922,6 +928,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 | @@ -1412,6 +1421,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 | -- | ||
90 | 2.25.1 | ||
91 | |||