summaryrefslogtreecommitdiffstats
path: root/common/location.te
blob: 805130c3bc26e26d4593e6629099380abd1868e4 (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
# location - Location daemon
type location, domain;
type location_exec, exec_type, file_type;

init_daemon_domain(location)
net_domain(location)

# Socket is created by the daemon, not by init, and under /data/gps,
# not under /dev/socket.
type_transition location location_data_file:sock_file location_socket;

qmux_socket(location)
binder_use(location)
binder_call(location, system_server)

allow location location_data_file:dir rw_dir_perms;
allow location location_data_file:{ file fifo_file } create_file_perms;
allow location location_data_file:sock_file write;
allow location location_exec:file x_file_perms;
allow location location_socket:sock_file create_file_perms;
allow location self:capability { setuid setgid net_admin net_raw };
allow location self:{
    socket
    netlink_socket
} create_socket_perms;

unix_socket_connect(location, sensors, sensors)
allow location sensors_device:chr_file r_file_perms;
allow location sensors_socket:sock_file rw_file_perms;
allow location shell_exec:file rx_file_perms;

allow location system_server:unix_stream_socket { read write connectto};

# For interfacing with the device sensorservice
allow location sensorservice_service:service_manager find;

#wifi
allow location wifi_data_file:dir r_dir_perms;
unix_socket_send(wpa, location, location)
allow location wpa:unix_dgram_socket sendto;
allow location wpa_socket:dir rw_dir_perms;
allow location wpa_socket:sock_file create_file_perms;

r_dir_file(location, rfs_shared_hlos_file)

dontaudit location domain:dir r_dir_perms;
r_dir_file(location, netmgrd)
allow location persist_file:dir r_dir_perms;

#Allow access to netmgrd socket
netmgr_socket(location);