Skip to content
Snippets Groups Projects
Commit 2d019f85 authored by Jin Qian's avatar Jin Qian
Browse files

init: manually restorecon mke2fs tools on ramdisk

Files in the ramdisk by default have the rootfs label and must be
manually restoreconed.

Bug: 35219933
Change-Id: I2a749f128dc3a609907101ce703747f8990b4386
parent 5ad06cbb
No related branches found
No related tags found
No related merge requests found
...@@ -863,9 +863,9 @@ static void selinux_initialize(bool in_kernel_domain) { ...@@ -863,9 +863,9 @@ static void selinux_initialize(bool in_kernel_domain) {
} }
} }
// The files and directories that were created before initial sepolicy load // The files and directories that were created before initial sepolicy load or
// need to have their security context restored to the proper value. // files on ramdisk need to have their security context restored to the proper
// This must happen before /dev is populated by ueventd. // value. This must happen before /dev is populated by ueventd.
static void selinux_restore_context() { static void selinux_restore_context() {
LOG(INFO) << "Running restorecon..."; LOG(INFO) << "Running restorecon...";
restorecon("/dev"); restorecon("/dev");
...@@ -882,6 +882,9 @@ static void selinux_restore_context() { ...@@ -882,6 +882,9 @@ static void selinux_restore_context() {
restorecon("/sys", SELINUX_ANDROID_RESTORECON_RECURSE); restorecon("/sys", SELINUX_ANDROID_RESTORECON_RECURSE);
restorecon("/dev/block", SELINUX_ANDROID_RESTORECON_RECURSE); restorecon("/dev/block", SELINUX_ANDROID_RESTORECON_RECURSE);
restorecon("/dev/device-mapper"); restorecon("/dev/device-mapper");
restorecon("/sbin/mke2fs");
restorecon("/sbin/e2fsdroid");
} }
// Set the UDC controller for the ConfigFS USB Gadgets. // Set the UDC controller for the ConfigFS USB Gadgets.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment