Android selinux te文件说明
1.selinux 类型加强文件te文件说明讲解:
https://blog.csdn.net/murphykwu/article/details/52457667
2. selinux attribute和type之间关系说明
https://blog.csdn.net/ldswfun/article/details/125284523
3.新追加hidl service需要修改的配置文件
3.1 device目录下的manifest.xml追加hidl service。
3.2 device目录下的vendor_framework_compatibility_matrix.xml文件需要配置hidl service。
3.3 注册server和service 调用类型加强TE文件中的宏函数:
init_daemon(hal_xx_default); //这个宏函数会进行切换Init for的进程的上下文,宏函数里,会有hal_xx_default_exec切换到hal_xx_default的安全上下文,后面这个进程就收到hal_xx_default这个type的权限控制了。
hal_server_domain(hal_xx_default, hal_xx) //这个宏函数,将hal_xx_default关联到halserverdomain属性,就定义自己为server了。
4.file_contexts中的文件type定义
/etc/foo.conf system_u:object_r:foo_conf_t:s0
用户:角色:type:安全级别
其中system_u的用户并不是inux的用户组概念,而是安全策略的用户
5.当出现selinux访问控制问题时:
可以通过dmesg | grep avc 来查看权限控制记录的问题。
通过setenforce 0来关闭selinux

浙公网安备 33010602011771号