From 89d6913cf2d02782662569009703ff2e0d34b689 Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Tue, 22 Mar 2022 21:51:07 +0900 Subject: [PATCH] restorecon /dev/console at the second stage boot It could be the case that /dev/console is created at the first stage boot. ueventd doesn't have a permission to relabel from tmpfs to console_device, so we should try restorecon /dev/console, together with /dev. Bug: 193118220 Test: atest MicrodroidHostTestCases Change-Id: Ic538bc9214d3996fe7b37fa2224c1f0c6eb373d1 --- init/selinux.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/init/selinux.cpp b/init/selinux.cpp index c89c5abbc..be8c5542f 100644 --- a/init/selinux.cpp +++ b/init/selinux.cpp @@ -762,6 +762,7 @@ void SelinuxAvcLog(char* buf, size_t buf_len) { void SelinuxRestoreContext() { LOG(INFO) << "Running restorecon..."; selinux_android_restorecon("/dev", 0); + selinux_android_restorecon("/dev/console", 0); selinux_android_restorecon("/dev/kmsg", 0); if constexpr (WORLD_WRITABLE_KMSG) { selinux_android_restorecon("/dev/kmsg_debug", 0);