Merge changes from topic "lpdumpd" am: 40f1682ba6

am: 7f891f414f

Change-Id: Id3aea81bb90391b88942cf0f0d318ab040705fb9
This commit is contained in:
Yifan Hong 2019-03-26 15:35:01 -07:00 committed by android-build-merger
commit 75117c19c9
19 changed files with 70 additions and 8 deletions

View file

@ -45,6 +45,7 @@ allow atrace {
-dumpstate_service
-installd_service
-vold_service
-lpdump_service
}:service_manager { find };
allow atrace servicemanager:service_manager list;

View file

@ -84,6 +84,10 @@
llkd_prop
llkd_tmpfs
looper_stats_service
lpdumpd
lpdumpd_exec
lpdumpd_prop
lpdump_service
iorapd
iorapd_exec
iorapd_data_file

View file

@ -262,6 +262,7 @@
/system/bin/usbd u:object_r:usbd_exec:s0
/system/bin/inputflinger u:object_r:inputflinger_exec:s0
/system/bin/logd u:object_r:logd_exec:s0
/system/bin/lpdumpd u:object_r:lpdumpd_exec:s0
/system/bin/rss_hwm_reset u:object_r:rss_hwm_reset_exec:s0
/system/bin/perfetto u:object_r:perfetto_exec:s0
/system/bin/traced u:object_r:traced_exec:s0

45
private/lpdumpd.te Normal file
View file

@ -0,0 +1,45 @@
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. This may live on
# super_block_device, or system_block_device (on retrofit devices).
allow lpdumpd {
super_block_device
system_block_device
}: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
} lpdumpd:binder call;

View file

@ -23,6 +23,7 @@ hw. u:object_r:system_prop:s0
ro.hw. u:object_r:system_prop:s0
sys. u:object_r:system_prop:s0
sys.cppreopt u:object_r:cppreopt_prop:s0
sys.lpdumpd u:object_r:lpdumpd_prop:s0
sys.powerctl u:object_r:powerctl_prop:s0
sys.usb.ffs. u:object_r:ffs_prop:s0
service. u:object_r:system_prop:s0

View file

@ -103,6 +103,7 @@ launcherapps u:object_r:launcherapps_service:s0
location u:object_r:location_service:s0
lock_settings u:object_r:lock_settings_service:s0
looper_stats u:object_r:looper_stats_service:s0
lpdump_service u:object_r:lpdump_service:s0
media.aaudio u:object_r:audioserver_service:s0
media.audio_flinger u:object_r:audioserver_service:s0
media.audio_policy u:object_r:audioserver_service:s0

View file

@ -70,3 +70,7 @@ allow shell system_linker_exec:file rx_file_perms;
# Renderscript host side tests depend on being able to execute
# /system/bin/bcc (b/126388046)
allow shell rs_exec:file rx_file_perms;
# Allow shell to start and comminicate with lpdumpd.
set_prop(shell, lpdumpd_prop);
binder_call(shell, lpdumpd)

View file

@ -80,6 +80,7 @@ allow system_app {
-installd_service
-iorapd_service
-ipmemorystore_service
-lpdump_service
-netd_service
-system_suspend_control_service
-virtual_touchpad_service

View file

@ -16,7 +16,7 @@ recovery_only(`
allowxperm fastbootd functionfs:file ioctl { FUNCTIONFS_ENDPOINT_DESC };
# Log to serial
allow fastbootd kmsg_device:chr_file { open write };
allow fastbootd kmsg_device:chr_file { open getattr write };
# battery info
allow fastbootd sysfs_batteryinfo:file r_file_perms;

View file

@ -21,7 +21,7 @@ r_dir_file(hal_health_server, sysfs_batteryinfo)
wakelock_use(hal_health_server)
# Write to /dev/kmsg
allow hal_health_server kmsg_device:chr_file w_file_perms;
allow hal_health_server kmsg_device:chr_file { getattr w_file_perms };
# Allow to use timerfd to wake itself up periodically to send health info.
allow hal_health_server self:capability2 wake_alarm;

View file

@ -11,7 +11,7 @@ allow init tmpfs:chr_file { create setattr unlink rw_file_perms };
#
# /dev/kmsg
allow init tmpfs:chr_file relabelfrom;
allow init kmsg_device:chr_file { write relabelto };
allow init kmsg_device:chr_file { getattr write relabelto };
# /dev/kmsg_debug
userdebug_or_eng(`
allow init kmsg_debug_device:chr_file { write relabelto };

View file

@ -11,7 +11,7 @@ allow logd self:global_capability_class_set { setuid setgid setpcap sys_nice aud
allow logd self:global_capability2_class_set syslog;
allow logd self:netlink_audit_socket { create_socket_perms_no_ioctl nlmsg_write };
allow logd kernel:system syslog_read;
allow logd kmsg_device:chr_file w_file_perms;
allow logd kmsg_device:chr_file { getattr w_file_perms };
allow logd system_data_file:{ file lnk_file } r_file_perms;
allow logd pstorefs:dir search;
allow logd pstorefs:file r_file_perms;

View file

@ -58,6 +58,7 @@ type logpersistd_logging_prop, property_type;
type log_prop, property_type, log_property_type;
type log_tag_prop, property_type, log_property_type;
type lowpan_prop, property_type;
type lpdumpd_prop, property_type;
type mmc_prop, property_type;
type net_dns_prop, property_type;
type net_radio_prop, property_type, core_property_type;
@ -430,6 +431,7 @@ compatible_property_only(`
-logd_prop
-logpersistd_logging_prop
-lowpan_prop
-lpdumpd_prop
-mmc_prop
-net_dns_prop
-net_radio_prop

View file

@ -16,6 +16,7 @@ type iorapd_service, service_manager_type;
type incident_service, service_manager_type;
type installd_service, service_manager_type;
type keystore_service, service_manager_type;
type lpdump_service, service_manager_type;
type mediaserver_service, service_manager_type;
type mediametrics_service, service_manager_type;
type mediaextractor_service, service_manager_type;

View file

@ -14,6 +14,7 @@ allow traceur_app {
-installd_service
-ipmemorystore_service
-iorapd_service
-lpdump_service
-netd_service
-virtual_touchpad_service
-vold_service

View file

@ -13,7 +13,7 @@ allow update_engine self:global_capability_class_set { fowner sys_admin };
# denial.
dontaudit update_engine self:global_capability_class_set fsetid;
allow update_engine kmsg_device:chr_file w_file_perms;
allow update_engine kmsg_device:chr_file { getattr w_file_perms };
allow update_engine update_engine_exec:file rx_file_perms;
wakelock_use(update_engine);

View file

@ -22,7 +22,7 @@ allow update_verifier sysfs_dm:file r_file_perms;
allow update_verifier dm_device:blk_file r_file_perms;
# Write to kernel message.
allow update_verifier kmsg_device:chr_file w_file_perms;
allow update_verifier kmsg_device:chr_file { getattr w_file_perms };
# Allow update_verifier to reboot the device.
set_prop(update_verifier, powerctl_prop)

View file

@ -12,7 +12,7 @@ type vdc_exec, system_file_type, exec_type, file_type;
allow vdc devpts:chr_file rw_file_perms;
# vdc writes directly to kmsg during the boot process
allow vdc kmsg_device:chr_file w_file_perms;
allow vdc kmsg_device:chr_file { getattr w_file_perms };
# vdc talks to vold over Binder
binder_use(vdc)

View file

@ -5,7 +5,7 @@ type vendor_init, domain, mlstrustedsubject;
allow vendor_init init:unix_stream_socket { read write };
# Logging to kmsg
allow vendor_init kmsg_device:chr_file { open write };
allow vendor_init kmsg_device:chr_file { open getattr write };
# Mount on /dev/usb-ffs/adb.
allow vendor_init device:dir mounton;