platform_system_sepolicy/lmkd.te
Colin Cross 5329731802 lmkd: allow removing cgroups and setting self to SCHED_FIFO
Addresses the following selinux denials:
type=1400 audit(1405383429.107:22): avc: denied { remove_name } for pid=137 comm="lmkd" name="uid_10060" dev="cgroup" ino=18368 scontext=u:r:lmkd:s0 tcontext=u:object_r:cgroup:s0 tclass=dir permissive=0
type=1400 audit(1405383794.109:6): avc: denied { sys_nice } for pid=1619 comm="lmkd" capability=23 scontext=u:r:lmkd:s0 tcontext=u:r:lmkd:s0 tclass=capability permissive=0

Change-Id: I7b6e5a396bf345c4768defd7b39af2435631a35b
2014-07-14 17:43:32 -07:00

26 lines
691 B
Text

# lmkd low memory killer daemon
type lmkd, domain;
type lmkd_exec, exec_type, file_type;
init_daemon_domain(lmkd)
allow lmkd self:capability { dac_override sys_resource kill };
## Open and write to /proc/PID/oom_score_adj
## TODO: maybe scope this down?
r_dir_file(lmkd, appdomain)
allow lmkd appdomain:file write;
r_dir_file(lmkd, system_server)
allow lmkd system_server:file write;
## Writes to /sys/module/lowmemorykiller/parameters/minfree
allow lmkd sysfs_lowmemorykiller:file w_file_perms;
# Send kill signals
allow lmkd appdomain:process sigkill;
# Clean up old cgroups
allow lmkd cgroup:dir { remove_name rmdir };
# Set self to SCHED_FIFO
allow lmkd self:capability sys_nice;