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>
This commit is contained in:
Stephen Smalley 2014-07-17 14:54:44 -04:00 committed by Ruchi Kandoi
parent 4ddc6eb39e
commit 9a725b284e

View File

@ -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 };