From 8c224faa24039853028c3d9c0e1eadc5ef7bd935 Mon Sep 17 00:00:00 2001 From: Alex Hong Date: Thu, 22 Apr 2021 16:35:51 +0800 Subject: [PATCH] Set the log callback earlier for showing system property set denials PropertyInit loads the build.prop files and set the system properties. Set the SELinux log callback before that to show the avc denials for debugging. Test: $ make init_system Push this module and ensure system property set denials are shown during boot Bug: 185920634 Change-Id: Ifc228985a990f6938ad2a93790eb3607b2d12b5a --- init/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/init.cpp b/init/init.cpp index a7325cad9..388251397 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -784,6 +784,7 @@ int SecondStageMain(int argc, char** argv) { UmountDebugRamdisk(); } + SelinuxSetupKernelLogging(); PropertyInit(); // Umount second stage resources after property service has read the .prop files. @@ -798,7 +799,6 @@ int SecondStageMain(int argc, char** argv) { MountExtraFilesystems(); // Now set up SELinux for second stage. - SelinuxSetupKernelLogging(); SelabelInitialize(); SelinuxRestoreContext();