platform_system_sepolicy/public/iorapd.te
Jeff Vander Stoep 6742ab4e4e iorapd: add tmpfs type
Fixes build breakage:
system/sepolicy/private/traced.te:36:ERROR 'unknown type iorapd_tmpfs' at token ';' on line 43166:

Bug: 123445058
Test: build marlin-userdebug
Change-Id: Iefeba03ed2efee92fb0d61214514338c6d999bd1
(cherry picked from commit 426ff11951)
2019-01-26 12:55:13 -08:00

79 lines
2.1 KiB
Text

# volume manager
type iorapd, domain;
type iorapd_exec, exec_type, file_type, system_file_type;
type iorapd_tmpfs, file_type;
r_dir_file(iorapd, rootfs)
# Allow read/write /proc/sys/vm/drop/caches
allow iorapd proc_drop_caches:file rw_file_perms;
# Give iorapd a place where only iorapd can store files; everyone else is off limits
allow iorapd iorapd_data_file:dir create_dir_perms;
allow iorapd iorapd_data_file:file create_file_perms;
# Allow iorapd to publish a binder service and make binder calls.
binder_use(iorapd)
add_service(iorapd, iorapd_service)
# Allow iorapd to call into the system server so it can check permissions.
binder_call(iorapd, system_server)
allow iorapd permission_service:service_manager find;
# IUserManager
allow iorapd user_service:service_manager find;
# IPackageManagerNative
allow iorapd package_native_service:service_manager find;
# talk to batteryservice
binder_call(iorapd, healthd)
# TODO: does each of the service_manager allow finds above need the binder_call?
# iorapd temporarily changes its priority when running benchmarks
allow iorapd self:global_capability_class_set sys_nice;
# Allow to access Perfetto traced's privileged consumer socket to start/stop
# tracing sessions and read trace data.
unix_socket_connect(iorapd, traced_consumer, traced)
###
### neverallow rules
###
neverallow {
domain
-iorapd
} iorapd_data_file:dir ~{ open create read getattr setattr search relabelto ioctl };
neverallow {
domain
-init
-iorapd
} iorapd_data_file:dir *;
neverallow {
domain
-kernel
-iorapd
} iorapd_data_file:notdevfile_class_set ~{ relabelto getattr };
neverallow {
domain
-init
-kernel
-vendor_init
-iorapd
} { iorapd_data_file }:notdevfile_class_set *;
# Only system_server can interact with iorapd over binder
neverallow { domain -system_server -iorapd } iorapd_service:service_manager find;
neverallow iorapd {
domain
-healthd
-servicemanager
-system_server
userdebug_or_eng(`-su')
}:binder call;
neverallow { domain -init } iorapd:process { transition dyntransition };
neverallow iorapd domain:{ tcp_socket udp_socket rawip_socket } *;