d22987b4da
Motivation: Domain is overly permissive. Start removing permissions from domain and assign them to the domain_deprecated attribute. Domain_deprecated and domain can initially be assigned to all domains. The goal is to not assign domain_deprecated to new domains and to start removing domain_deprecated where it is not required or reassigning the appropriate permissions to the inheriting domain when necessary. Bug: 25433265 Change-Id: I8b11cb137df7bdd382629c98d916a73fe276413c
29 lines
918 B
Text
29 lines
918 B
Text
# gpsd - GPS daemon
|
|
type gpsd, domain, domain_deprecated;
|
|
type gpsd_exec, exec_type, file_type;
|
|
|
|
init_daemon_domain(gpsd)
|
|
net_domain(gpsd)
|
|
allow gpsd gps_data_file:dir rw_dir_perms;
|
|
allow gpsd gps_data_file:notdevfile_class_set create_file_perms;
|
|
# Socket is created by the daemon, not by init, and under /data/gps,
|
|
# not under /dev/socket.
|
|
type_transition gpsd gps_data_file:sock_file gps_socket;
|
|
allow gpsd gps_socket:sock_file create_file_perms;
|
|
# XXX Label sysfs files with a specific type?
|
|
allow gpsd sysfs:file rw_file_perms;
|
|
|
|
allow gpsd gps_device:chr_file rw_file_perms;
|
|
|
|
# Execute the shell or system commands.
|
|
allow gpsd shell_exec:file rx_file_perms;
|
|
allow gpsd system_file:file rx_file_perms;
|
|
allow gpsd toolbox_exec:file rx_file_perms;
|
|
|
|
###
|
|
### neverallow
|
|
###
|
|
|
|
# gpsd can never have capabilities other than block_suspend
|
|
neverallow gpsd self:capability *;
|
|
neverallow gpsd self:capability2 ~block_suspend;
|