Merge "Remove healthd." am: 48732e041c

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1865953

Change-Id: Ib1ec297be792ecc783dfdfa52ae3c939e5e1bd29
This commit is contained in:
Yifan Hong 2021-10-22 00:19:07 +00:00 committed by Automerger Merge Worker
commit a0f7f4c30a
13 changed files with 4 additions and 76 deletions

View file

@ -44,7 +44,6 @@ allow atrace servicemanager:service_manager list;
# Allow notifying the processes hosting specific binder services that # Allow notifying the processes hosting specific binder services that
# trace-related system properties have changed. # trace-related system properties have changed.
binder_use(atrace) binder_use(atrace)
allow atrace healthd:binder call;
allow atrace surfaceflinger:binder call; allow atrace surfaceflinger:binder call;
allow atrace system_server:binder call; allow atrace system_server:binder call;
allow atrace cameraserver:binder call; allow atrace cameraserver:binder call;

View file

@ -3,6 +3,7 @@
(type apex_permission_data_file) (type apex_permission_data_file)
(type apex_scheduling_data_file) (type apex_scheduling_data_file)
(type apex_wifi_data_file) (type apex_wifi_data_file)
(type healthd_exec)
(type vr_hwc) (type vr_hwc)
(type vr_hwc_exec) (type vr_hwc_exec)

View file

@ -190,7 +190,6 @@ full_treble_only(`
-bootstat -bootstat
-charger -charger
-dumpstate -dumpstate
-healthd
userdebug_or_eng(`-incidentd') userdebug_or_eng(`-incidentd')
-init -init
-logd -logd

View file

@ -409,7 +409,6 @@ neverallow {
-init -init
-recovery -recovery
-ueventd -ueventd
-healthd
-uncrypt -uncrypt
-tee -tee
-hal_bootctl_server -hal_bootctl_server

View file

@ -292,7 +292,6 @@
/system/bin/racoon u:object_r:racoon_exec:s0 /system/bin/racoon u:object_r:racoon_exec:s0
/system/xbin/su u:object_r:su_exec:s0 /system/xbin/su u:object_r:su_exec:s0
/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 /system/bin/dnsmasq u:object_r:dnsmasq_exec:s0
/system/bin/healthd u:object_r:healthd_exec:s0
/system/bin/clatd u:object_r:clatd_exec:s0 /system/bin/clatd u:object_r:clatd_exec:s0
/system/bin/linker(64)? u:object_r:system_linker_exec:s0 /system/bin/linker(64)? u:object_r:system_linker_exec:s0
/system/bin/linkerconfig u:object_r:linkerconfig_exec:s0 /system/bin/linkerconfig u:object_r:linkerconfig_exec:s0

View file

@ -1,12 +1 @@
typeattribute healthd coredomain; typeattribute healthd coredomain;
init_daemon_domain(healthd)
# Allow healthd to serve health HAL
hal_server_domain(healthd, hal_health)
# Healthd needs to tell init to continue the boot
# process when running in charger mode.
set_prop(healthd, system_prop)
set_prop(healthd, exported_system_prop)
set_prop(healthd, exported3_system_prop)

View file

@ -3,7 +3,6 @@ typeattribute init coredomain;
tmpfs_domain(init) tmpfs_domain(init)
# Transitions to seclabel processes in init.rc # Transitions to seclabel processes in init.rc
domain_trans(init, rootfs, healthd)
domain_trans(init, rootfs, slideshow) domain_trans(init, rootfs, slideshow)
domain_auto_trans(init, charger_exec, charger) domain_auto_trans(init, charger_exec, charger)
domain_auto_trans(init, e2fs_exec, e2fs) domain_auto_trans(init, e2fs_exec, e2fs)

View file

@ -1350,11 +1350,10 @@ neverallow {
-coredomain -coredomain
} mnt_product_file:dir *; } mnt_product_file:dir *;
# Platform must not have access to sysfs_batteryinfo, but should do it via health HAL and healthd # Platform must not have access to sysfs_batteryinfo, but should do it via health HAL
full_treble_only(` full_treble_only(`
neverallow { neverallow {
coredomain coredomain
-healthd
-shell -shell
# For access to block device information under /sys/class/block. # For access to block device information under /sys/class/block.
-apexd -apexd

View file

@ -1,50 +1,4 @@
# healthd - battery/charger monitoring service daemon # healthd - battery/charger monitoring service daemon
# healthd is removed. The type is kept for backwards compatibility.
type healthd, domain; type healthd, domain;
type healthd_exec, system_file_type, exec_type, file_type;
# Write to /dev/kmsg
allow healthd kmsg_device:chr_file rw_file_perms;
# Read access to pseudo filesystems.
allow healthd sysfs_type:dir search;
# Allow to read /sys/class/power_supply directory.
allow healthd sysfs:dir r_dir_perms;
r_dir_file(healthd, rootfs)
r_dir_file(healthd, cgroup)
r_dir_file(healthd, cgroup_v2)
allow healthd self:global_capability_class_set { sys_tty_config };
allow healthd self:global_capability_class_set sys_boot;
dontaudit healthd self:global_capability_class_set sys_resource;
allow healthd self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
wakelock_use(healthd)
hal_client_domain(healthd, hal_health)
# Read/write to /sys/power/state
allow healthd sysfs_power:file rw_file_perms;
# TODO: added to match above sysfs rule. Remove me?
allow healthd sysfs_usb:file write;
r_dir_file(healthd, sysfs_batteryinfo)
###
### healthd: charger mode
###
# Read /sys/fs/pstore/console-ramoops
# Don't worry about overly broad permissions for now, as there's
# only one file in /sys/fs/pstore
allow healthd pstorefs:dir r_dir_perms;
allow healthd pstorefs:file r_file_perms;
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 proc_sysrq:file rw_file_perms;

View file

@ -27,9 +27,6 @@ allow iorapd package_native_service:service_manager find;
allow iorapd dumpstate:fd use; allow iorapd dumpstate:fd use;
allow iorapd dumpstate:fifo_file write; allow iorapd dumpstate:fifo_file write;
# talk to batteryservice
binder_call(iorapd, healthd)
# TODO: does each of the service_manager allow finds above need the binder_call? # TODO: does each of the service_manager allow finds above need the binder_call?
# iorapd temporarily changes its priority when running benchmarks # iorapd temporarily changes its priority when running benchmarks
@ -87,7 +84,6 @@ neverallow {
neverallow { domain -dumpstate -system_server -iorapd } iorapd_service:service_manager find; neverallow { domain -dumpstate -system_server -iorapd } iorapd_service:service_manager find;
neverallow iorapd { neverallow iorapd {
domain domain
-healthd
-servicemanager -servicemanager
-system_server -system_server
userdebug_or_eng(`-su') userdebug_or_eng(`-su')

View file

@ -25,7 +25,6 @@ allow statsd stats_data_file:file create_file_perms;
# Allow statsd to make binder calls to any binder service. # Allow statsd to make binder calls to any binder service.
binder_call(statsd, appdomain) binder_call(statsd, appdomain)
binder_call(statsd, healthd)
binder_call(statsd, incidentd) binder_call(statsd, incidentd)
binder_call(statsd, system_server) binder_call(statsd, system_server)

View file

@ -221,9 +221,6 @@ add_service(vold, vold_service)
binder_call(vold, system_server) binder_call(vold, system_server)
allow vold permission_service:service_manager find; allow vold permission_service:service_manager find;
# talk to batteryservice
binder_call(vold, healthd)
# talk to keymaster # talk to keymaster
hal_client_domain(vold, hal_keymaster) hal_client_domain(vold, hal_keymaster)
@ -344,7 +341,6 @@ neverallow vold {
-hal_keymaster_server -hal_keymaster_server
-system_suspend_server -system_suspend_server
-hal_bootctl_server -hal_bootctl_server
-healthd
-hwservicemanager -hwservicemanager
-iorapd_service -iorapd_service
-keystore -keystore

View file

@ -20,7 +20,6 @@ coredomainAllowlist = {
# TODO(b/152813275): need to avoid allowlist for rootdir # TODO(b/152813275): need to avoid allowlist for rootdir
"modprobe", "modprobe",
"slideshow", "slideshow",
"healthd",
} }
class scontext: class scontext: