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

vendor_shell: add sepolicy for vendor shell


Bug: 36463595
Test: Boot sailfish and make sure all vendor services that are shell scripts
      work. (Checke exited status)

Change-Id: I3d1d564114a914dec8179fb93a9e94493c2808da
Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
parent 4fe441fb
No related branches found
No related tags found
No related merge requests found
......@@ -265,6 +265,7 @@
# Vendor files
#
/(vendor|system/vendor)(/.*)? u:object_r:vendor_file:s0
/(vendor|system/vendor)/bin/sh u:object_r:vendor_shell_exec:s0
/(vendor|system/vendor)/bin/toybox_vendor u:object_r:vendor_toolbox_exec:s0
/(vendor|system/vendor)/etc(/.*)? u:object_r:vendor_configs_file:s0
......
......@@ -728,6 +728,13 @@ full_treble_only(`
-system_server
-zygote
} vendor_overlay_file:{ file lnk_file } r_file_perms;
# Non-vendor domains are not allowed to file execute shell
# from vendor
neverallow {
coredomain
-init
} vendor_shell_exec:file { execute execute_no_trans };
')
# Only authorized processes should be writing to files in /data/dalvik-cache
......
......@@ -395,6 +395,8 @@ allow init proc_meminfo:file r_file_perms;
allow init system_data_file:file { getattr read };
allow init system_data_file:lnk_file r_file_perms;
# For init to be able to run shell scripts from vendor
allow init vendor_shell_exec:file execute;
###
### neverallow rules
......
# vendor shell MUST never run as interactive or login shell.
# vendor shell CAN never be traisitioned to by any process, so it is
# only intended by shell script interpreter.
type vendor_shell_exec, exec_type, vendor_file_type, file_type;
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