From 7caa0ca4339503e83cfabd25e443e4c8789ab5ef Mon Sep 17 00:00:00 2001 From: Rick Yiu Date: Fri, 14 Jun 2019 16:37:41 +0800 Subject: [PATCH] Fix avc denied to dump some useful hals for user build. To get thermal/power/power_stats hals debug info in user build. Bug: 134545528 Test: tested in userdebug with dumpstate.unroot set to true Change-Id: I5594bb7b1a444529c6c4fa0e566b9aeca9792fb4 --- sepolicy/public/te_macros | 9 +++++++++ sepolicy/vendor/dumpstate.te | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 sepolicy/public/te_macros diff --git a/sepolicy/public/te_macros b/sepolicy/public/te_macros new file mode 100644 index 00000000..701ef555 --- /dev/null +++ b/sepolicy/public/te_macros @@ -0,0 +1,9 @@ +########################################### +# dump_hal(hal_type) +# Ability to dump the hal debug info +# +define(`dump_hal', ` + hal_client_domain(dumpstate, $1); + allow $1_server dumpstate:fifo_file write; + allow $1_server dumpstate:fd use; +') diff --git a/sepolicy/vendor/dumpstate.te b/sepolicy/vendor/dumpstate.te index faa81a65..a0a8af40 100644 --- a/sepolicy/vendor/dumpstate.te +++ b/sepolicy/vendor/dumpstate.te @@ -1,3 +1,7 @@ +dump_hal(hal_thermal) +dump_hal(hal_power) +dump_hal(hal_power_stats) + userdebug_or_eng(` allow dumpstate proc_modules:file r_file_perms; allow dumpstate proc_stat:file r_file_perms;