William Smith
unread,Nov 18, 2020, 2:35:20 PM11/18/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android Automotive OS Discussion Group, Android Automotive OS Discussion Group, pravee...@gmail.com
After you read the documentation, then this much I can say:
If you create a new service, HAL, app that uses it, etc:
- you need to define an selinux context with an appropriate name
- you need to add your files, app, executable, etc. to that context
- those files go into your device target folder under sepolicy and get added to your target makefile
- the sepolicy files are compiled into a blob that is loaded by the kernel
- it is a MAC (mandatory access control) security scheme (Ubuntu uses something called apparmor)
- error messages show up in dmesg (grep "avc" to filer them)
- avc error messages can be used to generate rules to a certain extent using audit2allow
(it doesn't help with file, app, etc. contexts)
- "setenforce 0" (or 1) disables it and enables it in a userdebug build
- here's some of the internal Android .te files with selinux policy rules in them with some documenation
- there are a thousands of selinux rules in Android
And some added for a specific product:
Treble uses selinux to enforce the separation between the vendor and system partitions.
Good luck!