From 6a3ef488e5fea4f9c5992c76f4b20e7c800881c1 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Tue, 14 May 2019 09:30:29 -0700 Subject: [PATCH] FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce When Android boots after file_contexts has changed, the boot process walks the entire /data partition, updating any changed SELinux labels as appropriate. However, credential encrypted ("ce") directories are deliberately excluded from this early boot directory walk. Files within ce directories have their filenames encrypted, and as a result, cannot match the file_contexts entries. Only after the user has unlocked their device are the unencrypted filenames available and a restorecon appropriate. Ensure that we do a post-unlock restorecon on /data/vendor_ce, like we do for /data/system_ce and /data/misc_ce. This ensures the labels on files within these directories are correct after the device has been unlocked. Bug: 132349934 Test: See bug 132349934 comment #12 for test procedure Change-Id: Ifcbef5fdfb236ec6dea418efa9d965db3a3b782f --- FsCrypt.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/FsCrypt.cpp b/FsCrypt.cpp index b7d3928..2a8e110 100644 --- a/FsCrypt.cpp +++ b/FsCrypt.cpp @@ -735,6 +735,7 @@ bool fscrypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_ // over these paths // NOTE: these paths need to be kept in sync with libselinux android::vold::RestoreconRecursive(system_ce_path); + android::vold::RestoreconRecursive(vendor_ce_path); android::vold::RestoreconRecursive(misc_ce_path); } }