init: reset overlay.d files context after sepolicy loaded

This commit is contained in:
5ec1cff
2024-12-27 12:35:29 -08:00
committed by John Wu
parent b6511a510d
commit 2b7be8b949
2 changed files with 59 additions and 0 deletions
+4
View File
@@ -131,6 +131,10 @@ bool MagiskInit::hijack_sepolicy() {
// Load patched policy into kernel
sepol->to_file(SELINUX_LOAD);
// restore mounted files' context after sepolicy loaded
void reset_overlay_contexts();
reset_overlay_contexts();
// Write to the enforce node ONLY after sepolicy is loaded. We need to make sure
// the actual init process is blocked until sepolicy is loaded, or else
// restorecon will fail and re-exec won't change context, causing boot failure.