summaryrefslogtreecommitdiffstats
path: root/recipes-security/refpolicy/refpolicy/0040-policy-modules-services-bluetooth-fix-bluetoothd-sta.patch
blob: 8532a24da1ca9c29fc88d0e4cc265d36c045b5d4 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
From 21c60a1ed37aef0427dbd49f602896b09b875bca Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Tue, 23 Jun 2020 08:54:20 +0800
Subject: [PATCH] policy/modules/services/bluetooth: fix bluetoothd startup
 failures

* Allow bluetooth_t to create and use bluetooth_socket
* Allow bluetooth_t to create alg_socket
* Allow bluetooth_t to send and receive messages from systemd hostnamed
  over dbus

Fixes:
avc: denied { create } for pid=324 comm="bluetoothd"
scontext=system_u:system_r:bluetooth_t
tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
permissive=0

avc: denied { bind } for pid=324 comm="bluetoothd"
scontext=system_u:system_r:bluetooth_t
tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
permissive=0

avc: denied { write } for pid=324 comm="bluetoothd"
scontext=system_u:system_r:bluetooth_t
tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
permissive=0

avc: denied { getattr } for pid=324 comm="bluetoothd"
path="socket:[11771]" dev="sockfs" ino=11771
scontext=system_u:system_r:bluetooth_t
tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
permissive=0

avc: denied { listen } for pid=324 comm="bluetoothd"
scontext=system_u:system_r:bluetooth_t
tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
permissive=0

avc: denied { read } for pid=324 comm="bluetoothd" path="socket:[11771]"
dev="sockfs" ino=11771 scontext=system_u:system_r:bluetooth_t
tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
permissive=0

avc:  denied  { create } for  pid=268 comm="bluetoothd"
scontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023
tcontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023 tclass=alg_socket
permissive=0

avc:  denied  { send_msg } for msgtype=method_call
interface=org.freedesktop.DBus.Properties member=GetAll
dest=org.freedesktop.hostname1 spid=266 tpid=312
scontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023
tcontext=system_u:system_r:systemd_hostnamed_t:s0-s15:c0.c1023
tclass=dbus permissive=0

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 policy/modules/services/bluetooth.te | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/policy/modules/services/bluetooth.te b/policy/modules/services/bluetooth.te
index 69a38543e..b3df695db 100644
--- a/policy/modules/services/bluetooth.te
+++ b/policy/modules/services/bluetooth.te
@@ -60,6 +60,8 @@ allow bluetooth_t self:socket create_stream_socket_perms;
 allow bluetooth_t self:unix_stream_socket { accept connectto listen };
 allow bluetooth_t self:tcp_socket { accept listen };
 allow bluetooth_t self:netlink_kobject_uevent_socket create_socket_perms;
+allow bluetooth_t self:bluetooth_socket create_stream_socket_perms;
+allow bluetooth_t self:alg_socket create;
 
 read_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_t)
 
@@ -127,6 +129,9 @@ userdom_dontaudit_use_unpriv_user_fds(bluetooth_t)
 userdom_dontaudit_use_user_terminals(bluetooth_t)
 userdom_dontaudit_search_user_home_dirs(bluetooth_t)
 
+init_dbus_send_script(bluetooth_t)
+systemd_dbus_chat_hostnamed(bluetooth_t)
+
 optional_policy(`
 	dbus_system_bus_client(bluetooth_t)
 	dbus_connect_system_bus(bluetooth_t)
-- 
2.17.1