From 32915658aa5692a4dec7055707289a1129d0462d Mon Sep 17 00:00:00 2001
From: Stephen Smalley <sds@tycho.nsa.gov>
Date: Thu, 17 Jul 2014 14:54:44 -0400
Subject: [PATCH] Allow init to restorecon sysfs files.

The boot-time restorecon_recursive("/sys") occurs while still in
the kernel domain, but init.rc files may nonetheless perform
restorecon_recursive of parts of /sys created later and therefore
require this permission.   Required for:
https://android-review.googlesource.com/#/c/101800/

Change-Id: I68dc2c6019a1f9deae3eec5c2f068365ce2372e5
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 init.te | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init.te b/init.te
index 361fb8766..b5b799330 100644
--- a/init.te
+++ b/init.te
@@ -36,6 +36,7 @@ allow init rootfs:file relabelfrom;
 # init.<board>.rc files often include device-specific types, so
 # we just allow all file types except /system files here.
 allow init {file_type -system_file -exec_type}:dir_file_class_set relabelto;
+allow init sysfs_type:{ dir file lnk_file } relabelto;
 
 # Unlabeled file access for upgrades from 4.2.
 allow init unlabeled:dir { create_dir_perms relabelfrom };
-- 
GitLab