diff --git a/private/file_contexts b/private/file_contexts index c31ec06e3..1bc17162e 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -265,6 +265,7 @@ # Vendor files # /(vendor|system/vendor)(/.*)? u:object_r:vendor_file: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 /(vendor|system/vendor)/lib(64)?/egl(/.*)? u:object_r:same_process_hal_file:s0 diff --git a/public/vendor_toolbox.te b/public/vendor_toolbox.te new file mode 100644 index 000000000..39462f8e7 --- /dev/null +++ b/public/vendor_toolbox.te @@ -0,0 +1,12 @@ +# Toolbox installation for vendor binaries / scripts +# Non-vendor processes are not allowed to execute the binary +# and is always executed without transition. +type vendor_toolbox_exec, exec_type, vendor_file_type, file_type; + +# Do not allow domains to transition to vendor toolbox +# 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 }; +')