summaryrefslogtreecommitdiffstats
path: root/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-systemd-enable-support-for-sys.patch
blob: 43b2f4d5ef63358144c09825df3e66a19da71307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 6465e39b6dfe8daa88cab321e3cf44ccc9f1441d Mon Sep 17 00:00:00 2001
From: Wenzong Fan <wenzong.fan@windriver.com>
Date: Thu, 4 Feb 2016 06:03:19 -0500
Subject: [PATCH] policy/modules/system/systemd: enable support for
 systemd-tmpfiles to manage all non-security files

Fixes:
systemd-tmpfiles[137]: Failed to create directory or subvolume "/var/volatile/log": Permission denied
systemd-tmpfiles[137]: Failed to create directory or subvolume "/var/volatile/tmp": Permission denied
systemd-tmpfiles[137]: Failed to create directory or subvolume "/var/log/audit": Permission denied

avc:  denied  { write } for  pid=137 comm="systemd-tmpfile" name="/"
dev="tmpfs" ino=12400 scontext=system_u:system_r:systemd_tmpfiles_t
tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=0

avc:  denied  { read } for  pid=137 comm="systemd-tmpfile" name="dbus"
dev="vda" ino=12363 scontext=system_u:system_r:systemd_tmpfiles_t
tcontext=system_u:object_r:system_dbusd_var_lib_t tclass=dir
permissive=0

avc:  denied  { relabelfrom } for  pid=137 comm="systemd-tmpfile"
name="log" dev="vda" ino=14129
scontext=system_u:system_r:systemd_tmpfiles_t
tcontext=system_u:object_r:var_log_t tclass=lnk_file permissive=0

avc:  denied  { create } for  pid=137 comm="systemd-tmpfile"
name="audit" scontext=system_u:system_r:systemd_tmpfiles_t
tcontext=system_u:object_r:auditd_log_t tclass=dir permissive=0

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 policy/modules/system/systemd.te | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
index ef25974ac..362248d17 100644
--- a/policy/modules/system/systemd.te
+++ b/policy/modules/system/systemd.te
@@ -10,7 +10,7 @@ policy_module(systemd)
 ## Enable support for systemd-tmpfiles to manage all non-security files.
 ## </p>
 ## </desc>
-gen_tunable(systemd_tmpfiles_manage_all, false)
+gen_tunable(systemd_tmpfiles_manage_all, true)
 
 ## <desc>
 ## <p>
@@ -1640,6 +1640,10 @@ files_relabelfrom_home(systemd_tmpfiles_t)
 files_relabelto_home(systemd_tmpfiles_t)
 files_relabelto_etc_dirs(systemd_tmpfiles_t)
 files_setattr_lock_dirs(systemd_tmpfiles_t)
+
+files_manage_non_auth_files(systemd_tmpfiles_t)
+files_relabel_non_auth_files(systemd_tmpfiles_t)
+
 # for /etc/mtab
 files_manage_etc_symlinks(systemd_tmpfiles_t)
 
-- 
2.25.1