Skip to content
Snippets Groups Projects
Commit d46b5d35 authored by Sandeep Patil's avatar Sandeep Patil
Browse files

Allow init to run vendor toybox for modprobe


vendor implementations need to be able to run modprobe as part of
init.rc scripts.  They cannot do so because of the strict neverallow
currently in place that disallows all coredomains (including init)
to execute vendor toybox.

Fix this by adding init to the exception list for the neverallow so
vendors can then run modprobe from .rc scripts and also add the rule to
allow init to transition to modprobe domain using vendor_toolbox.

Bug: b/38212864
Test: Boot sailfish

Change-Id: Ib839246954e9002859f3ba986094f206bfead137
Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
parent 9c87eb45
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,7 @@ recovery_only(`
domain_trans(init, shell_exec, shell)
domain_trans(init, init_exec, ueventd)
domain_trans(init, init_exec, watchdogd)
domain_trans(init, rootfs, modprobe)
domain_trans(init, toolbox_exec, modprobe)
domain_trans(init, { rootfs toolbox_exec vendor_toolbox_exec }, modprobe)
# case where logpersistd is actually logcat -f in logd context (nee: logcatd)
userdebug_or_eng(`
domain_auto_trans(init, logcat_exec, logpersist)
......
......@@ -7,6 +7,10 @@ type vendor_toolbox_exec, exec_type, vendor_file_type, file_type;
# or read, execute the vendor_toolbox file.
full_treble_only(`
# Do not allow non-vendor domains to transition
# to vendor toolbox
neverallow coredomain vendor_toolbox_exec:file { entrypoint execute execute_no_trans };
# to vendor toolbox except for the whitelisted domains.
neverallow {
coredomain
-init
-modprobe
} vendor_toolbox_exec:file { entrypoint execute execute_no_trans };
')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment