diff --git a/adbd.te b/adbd.te index 362318034c33bcd07265768acb0f42bfdb595408..1786ec22f1b19d98d1d6fe1b52462fc3b4c3adf0 100644 --- a/adbd.te +++ b/adbd.te @@ -34,6 +34,10 @@ allow adbd devpts:chr_file rw_file_perms; allow adbd shell_data_file:dir create_dir_perms; allow adbd shell_data_file:file create_file_perms; +# adb pull /data/misc/profman. +allow adbd profman_dump_data_file:dir r_dir_perms; +allow adbd profman_dump_data_file:file r_file_perms; + # adb push/pull sdcard. allow adbd tmpfs:dir search; allow adbd rootfs:lnk_file r_file_perms; # /sdcard symlink diff --git a/file.te b/file.te index 0e443278f6363efc6072fe82dd5b1e931bda7d2f..3982a8d25e2ddf74a8c57470643e049ea77c25af 100644 --- a/file.te +++ b/file.te @@ -93,6 +93,8 @@ type ota_data_file, file_type, data_file_type; # /data/misc/profiles type user_profile_data_file, file_type, data_file_type, mlstrustedobject; type user_profile_foreign_dex_data_file, file_type, data_file_type, mlstrustedobject; +# /data/misc/profman +type profman_dump_data_file, file_type, data_file_type; # /data/resource-cache type resourcecache_data_file, file_type, data_file_type; # /data/local - writable by shell diff --git a/file_contexts b/file_contexts index d17a54fedb827c24998a4cf1d2698473268c04b5..7e34686376ae11a0075676e832d9ab4588d28267 100644 --- a/file_contexts +++ b/file_contexts @@ -295,6 +295,7 @@ /data/misc/profiles/cur(/.*)? u:object_r:user_profile_data_file:s0 /data/misc/profiles/cur/[0-9]+/foreign-dex(/.*)? u:object_r:user_profile_foreign_dex_data_file:s0 /data/misc/profiles/ref(/.*)? u:object_r:user_profile_data_file:s0 +/data/misc/profman(/.*)? u:object_r:profman_dump_data_file:s0 # Fingerprint data /data/system/users/[0-9]+/fpdata(/.*)? u:object_r:fingerprintd_data_file:s0 diff --git a/installd.te b/installd.te index a66f9ff95faefa9f1ba4be2571d63628e908cce9..f7f7409e25f699224e8582b94f6ce42a8ad27a2a 100644 --- a/installd.te +++ b/installd.te @@ -117,6 +117,9 @@ allow installd user_profile_data_file:dir create_dir_perms; allow installd user_profile_data_file:file create_file_perms; allow installd user_profile_data_file:dir rmdir; allow installd user_profile_data_file:file unlink; +# Files created/updated by profman dumps. +allow installd profman_dump_data_file:dir { search add_name write }; +allow installd profman_dump_data_file:file { create setattr open write }; # Create and use pty created by android_fork_execvp(). allow installd devpts:chr_file rw_file_perms; diff --git a/profman.te b/profman.te index 92a23e22fd061fe7c452dafac4729e61a211b3ab..9897069622d5ac72d1afbdbf5f159b2f47c3a3aa 100644 --- a/profman.te +++ b/profman.te @@ -4,6 +4,8 @@ type profman_exec, exec_type, file_type; allow profman user_profile_data_file:file { getattr read write lock }; +allow profman profman_dump_data_file:file { write }; + allow profman installd:fd use; neverallow profman app_data_file:notdevfile_class_set open; diff --git a/shell.te b/shell.te index 991a3371a86ea676be2478609f41f5e94fbd113e..f5eee11813aeeaacf89852bc9eae766505dbc570 100644 --- a/shell.te +++ b/shell.te @@ -34,6 +34,10 @@ allow shell shell_data_file:file create_file_perms; allow shell shell_data_file:file rx_file_perms; allow shell shell_data_file:lnk_file create_file_perms; +# Access /data/misc/profman. +allow shell profman_dump_data_file:dir { search getattr write remove_name }; +allow shell profman_dump_data_file:file { getattr unlink }; + # Read/execute files in /data/nativetest userdebug_or_eng(` allow shell nativetest_data_file:dir r_dir_perms;