SEAndroid中各种实体的SContext 定义
介绍进程、文件/目录、服务、系统属性等SContext 定义
进程的SContext(以system_server进程为例)(对应每个进程的te文件)
u:r:system_server:s0 system 494 186 system_server
u表示user SELinux用户
r表示SELinux角色
system_server表示domain,该域的权限定义在策略文件system_server.te中
s0表示MLS中的级别,Android中可忽略
file和dir的SContext(以system目录为例)(在file_contexts定义)
drwxr-xr-x root root u:object_r:system_file:s0 system
object_r表示文件对象
system_file表示文件类型
fs_use(在fs_use定义)
// to do
生成 文件系统的 SContext (在genfs_contexts定义)
genfscon rootfs / u:object_r:rootfs:s0
genfscon usbfs / u:object_r:usbfs:s0
property的SContext(在property_contexts定义)
* u:object_r:default_prop:s0 //默认property SContext
hw. u:object_r:system_prop:s0
service的SContext(在service_contexts定义)
* u:object_r:default_android_service:s0 //默认服务SContext
package u:object_r:system_server_service:s0 //package 服务 (在shell中执行service list查看所有服务)