Skip to content
Snippets Groups Projects
Commit 0f3decf2 authored by Florian Mayer's avatar Florian Mayer
Browse files

Property to enable heap profile from process startup.

This is world-readable so it can be checked in libc's process init.

Test: m
Test: flash sailfish

Bug: 117821125

Change-Id: Iac7317ceb75b5ad9cfb9adabdf16929263fa8a9d
parent e80631ff
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@
hal_system_suspend_default_tmpfs
heapprofd
heapprofd_exec
heapprofd_prop
heapprofd_socket
idmap_service
intelligence_service
......
......@@ -5,6 +5,12 @@
domain_auto_trans({ domain userdebug_or_eng(`-su') }, crash_dump_exec, crash_dump);
allow domain crash_dump:process sigchld;
# Allow every process to check the heapprofd.enable properties to determine
# whether to load the heap profiling library. This does not necessarily enable
# heap profiling, as initialization will fail if it does not have the
# necessary SELinux permissions.
get_prop(domain, heapprofd_prop);
# Limit ability to ptrace or read sensitive /proc/pid files of processes
# with other UIDs to these whitelisted domains.
neverallow {
......
......@@ -3,6 +3,8 @@ type heapprofd_exec, exec_type, file_type, system_file_type;
init_daemon_domain(heapprofd)
set_prop(heapprofd, heapprofd_prop);
userdebug_or_eng(`
# Allow to send signal to processes.
# This excludes SIGKILL, SIGSTOP and SIGCHLD,
......
......@@ -143,6 +143,9 @@ wlan. u:object_r:wifi_prop:s0
lowpan. u:object_r:lowpan_prop:s0
ro.lowpan. u:object_r:lowpan_prop:s0
# heapprofd properties
heapprofd. u:object_r:heapprofd_prop:s0
# hwservicemanager properties
hwservicemanager. u:object_r:hwservicemanager_prop:s0
......
......@@ -38,6 +38,7 @@ type exported_secure_prop, property_type;
type ffs_prop, property_type, core_property_type;
type fingerprint_prop, property_type, core_property_type;
type firstboot_prop, property_type;
type heapprofd_prop, property_type;
type hwservicemanager_prop, property_type;
type last_boot_reason_prop, property_type;
type system_lmk_prop, property_type;
......@@ -396,6 +397,7 @@ compatible_property_only(`
-device_config_reset_performed_prop
-device_config_boot_count_prop
-device_config_flags_health_check_prop
-heapprofd_prop
-hwservicemanager_prop
-last_boot_reason_prop
-system_lmk_prop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment