diff --git a/domain.te b/domain.te index 3851506948625298497bd24f592e736d9076dcf2..5ed79c1ea8530c532cd1ae294441e36a03548141 100644 --- a/domain.te +++ b/domain.te @@ -59,6 +59,10 @@ userdebug_or_eng(` # allow "gdbserver --attach" to work for su. allow domain su:process sigchld; + + # Allow writing coredumps to /cores/* + allow domain coredump_file:file create_file_perms; + allow domain coredump_file:dir ra_dir_perms; ') ### diff --git a/file.te b/file.te index 5c91cf0e0c839c782f9722368898ca379a0c642f..9b7564fa9bd04b79a08ed348b80412e6b1223f1f 100644 --- a/file.te +++ b/file.te @@ -45,6 +45,8 @@ type unlabeled, file_type; type system_file, file_type; # Type for /system/bin/logcat. type logcat_exec, exec_type, file_type; +# /cores for coredumps on userdebug / eng builds +type coredump_file, file_type; # Default type for anything under /data. type system_data_file, file_type, data_file_type; # /data/.layout_version or other installd-created files that diff --git a/file_contexts b/file_contexts index 1d81cbfa1a39556d10d2ef2f776476fd38a2571d..038c8b6b488cebdd1b0a8a5efd72d37e998d90b9 100644 --- a/file_contexts +++ b/file_contexts @@ -223,6 +223,9 @@ /data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 /data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 +# coredump directory for userdebug/eng devices +/cores(/.*)? u:object_r:coredump_file:s0 + # Wallpaper file for other users /data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 #############################