51df227dec
Property being set: sys.boot_from_charger_mode. If healthd attempts to write this property without the policy changes we get the following audit message: [ 45.751195] type=1400 audit(1403556447.444:7): avc: denied { write } for pid=99 comm="charger" name="property_service" dev="tmpfs" ino=3229 scontext=u:r:healthd:s0 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 These changes are needed to support the following system/core commit: faster booting from charger mode * Ieec4494d929e92806e039f834d78b9002afd15c4 Change-Id: I9f198cd73c7b2f1e372c3793dc2b8d5ef26b3a0f
40 lines
1.3 KiB
Text
40 lines
1.3 KiB
Text
# healthd seclabel is specified in init.rc since
|
|
# it lives in the rootfs and has no unique file type.
|
|
type healthd, domain;
|
|
|
|
allow healthd rootfs:file { read entrypoint };
|
|
write_klog(healthd)
|
|
# /dev/__null__ created by init prior to policy load,
|
|
# open fd inherited by healthd.
|
|
allow healthd tmpfs:chr_file { read write };
|
|
|
|
allow healthd self:capability { net_admin mknod sys_tty_config };
|
|
wakelock_use(healthd)
|
|
allow healthd self:netlink_kobject_uevent_socket create_socket_perms;
|
|
binder_use(healthd)
|
|
binder_service(healthd)
|
|
binder_call(healthd, system_server)
|
|
|
|
# Write to state file.
|
|
# TODO: Split into a separate type?
|
|
allow healthd sysfs:file write;
|
|
|
|
###
|
|
### healthd: charger mode
|
|
###
|
|
|
|
allow healthd graphics_device:dir r_dir_perms;
|
|
allow healthd graphics_device:chr_file rw_file_perms;
|
|
allow healthd input_device:dir r_dir_perms;
|
|
allow healthd input_device:chr_file r_file_perms;
|
|
allow healthd tty_device:chr_file rw_file_perms;
|
|
allow healthd ashmem_device:chr_file execute;
|
|
allow healthd self:process execmem;
|
|
allow healthd proc_sysrq:file rw_file_perms;
|
|
allow healthd self:capability sys_boot;
|
|
allow healthd healthd_service:service_manager add;
|
|
|
|
# Healthd needs to tell init to continue the boot
|
|
# process when running in charger mode.
|
|
unix_socket_connect(healthd, property, init)
|
|
allow healthd system_prop:property_service set;
|