summaryrefslogtreecommitdiffstats
path: root/recipes-security/refpolicy/refpolicy/0049-policy-modules-system-init-all-init_t-to-read-any-le.patch
blob: 3c418ddd3dd5dce168c5153a601a36ec84c15d2f (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
From ad9b0e1542804060ac3cea69129c224074da6766 Mon Sep 17 00:00:00 2001
From: Wenzong Fan <wenzong.fan@windriver.com>
Date: Wed, 3 Feb 2016 04:16:06 -0500
Subject: [PATCH] policy/modules/system/init: all init_t to read any level
 sockets

Fixes:
  avc: denied { listen } for pid=1 comm="systemd" \
  path="/run/systemd/journal/stdout" \
  scontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
  tcontext=system_u:system_r:syslogd_t:s15:c0.c1023 \
  tclass=unix_stream_socket permissive=1

  systemd[1]: Failded to listen on Journal Socket

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/init.te | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
index bd2ca0802..e94a29a73 100644
--- a/policy/modules/system/init.te
+++ b/policy/modules/system/init.te
@@ -243,6 +243,9 @@ mls_key_write_all_levels(init_t)
 mls_file_downgrade(init_t)
 mls_file_upgrade(init_t)
 
+# MLS trusted for reading from sockets at any level
+mls_socket_read_all_levels(init_t)
+
 # the following one is needed for libselinux:is_selinux_enabled()
 # otherwise the call fails and sysvinit tries to load the policy
 # again when using the initramfs
-- 
2.25.1