platform_system_sepolicy/private/lpdumpd.te
Jon Spivack 4b9114a0b5 binder_use: Allow servicemanager callbacks
In order for services registered with LazyServiceRegistrar to dynamically stop, servicemanager needs to be able to call into client processes (to notify them and trigger shutdown).

Bug: 143108344
Test: aidl_lazy_test
Change-Id: I402d0bcc5e668bf022162c7ce7393d5b77256479
2019-12-19 23:07:14 +00:00

42 lines
1.1 KiB
Text

type lpdumpd, domain, coredomain;
type lpdumpd_exec, system_file_type, exec_type, file_type;
init_daemon_domain(lpdumpd)
# Allow lpdumpd to register itself as a service.
binder_use(lpdumpd)
add_service(lpdumpd, lpdump_service)
# Allow lpdumpd to find the super partition block device.
allow lpdumpd block_device:dir r_dir_perms;
# Allow lpdumpd to read super partition metadata.
allow lpdumpd super_block_device_type:blk_file r_file_perms;
# Allow lpdumpd to read fstab.
allow lpdumpd sysfs_dt_firmware_android:dir r_dir_perms;
allow lpdumpd sysfs_dt_firmware_android:file r_file_perms;
# Triggered when lpdumpd tries to read default fstab.
dontaudit lpdumpd metadata_file:dir r_dir_perms;
dontaudit lpdumpd metadata_file:file r_file_perms;
dontaudit lpdumpd gsi_metadata_file:dir r_dir_perms;
dontaudit lpdumpd gsi_metadata_file:file r_file_perms;
### Neverallow rules
# Disallow other domains to get lpdump_service and call lpdumpd.
neverallow {
domain
-dumpstate
-lpdumpd
-shell
} lpdump_service:service_manager find;
neverallow {
domain
-dumpstate
-lpdumpd
-shell
-servicemanager
} lpdumpd:binder call;