summaryrefslogtreecommitdiffstats
path: root/common/wcnss_service.te
blob: 2fc7b46cf4df6700c8127795ab167441ab7529c4 (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
type wcnss_service, domain, domain_deprecated;
type wcnss_service_exec, exec_type, file_type;

init_daemon_domain(wcnss_service)
net_domain(wcnss_service)

unix_socket_connect(wcnss_service, property, init)
allow wcnss_service wcnss_device:chr_file rw_file_perms;

qmux_socket(wcnss_service);

allow wcnss_service wifi_data_file:dir w_dir_perms;
allow wcnss_service wifi_data_file:file create_file_perms;

allow wcnss_service system_prop:property_service set;
allow wcnss_service persist_file:dir create_dir_perms;

allow wcnss_service self:socket create_socket_perms;
allow wcnss_service smem_log_device:chr_file rw_file_perms;
allow wcnss_service proc_net:file w_file_perms;

# allow wpa_supplicant to send back wifi information to cnd
allow wcnss_service cnd:unix_dgram_socket sendto;
allow wcnss_service self:capability {
    net_admin
    net_bind_service
};

allow wcnss_service self:netlink_socket create_socket_perms;
allow wcnss_service self:netlink_generic_socket create_socket_perms;
allow wcnss_service firmware_file:dir r_dir_perms;
allow wcnss_service firmware_file:file r_file_perms;
allow wcnss_service sysfs:file w_file_perms;
allow wcnss_service storage_file:dir search;

# allow access to netd
unix_socket_connect(wcnss_service, netd, netd)

userdebug_or_eng(`
allow wcnss_service fuse:dir create_dir_perms;
allow wcnss_service fuse:file create_file_perms;
allow wcnss_service vfat:dir create_dir_perms;
allow wcnss_service vfat:file create_file_perms;

# needed for wlan dynamic nv feature
allow wcnss_service persist_file:file { rw_file_perms setattr };

# This is needed for ptt_socket app to write logs file collected to sdcard
r_dir_file(wcnss_service, storage_file)
r_dir_file(wcnss_service, mnt_user_file)
diag_use(wcnss_service)
')

binder_use(wcnss_service)
use_per_mgr(wcnss_service)

type_transition wcnss_service persist_file:file wifi_data_file ".genmac";