log:
SELinux报错的标准格式是:
avc: denied { 操作权限 } for pid=26382 comm=“进程名”
scontext=u:r:源类型:s0 tcontext=u:r:目标类型:s0
tclass=访问类型 permissive=0
添加规则是,在源类型.te文件中添加 :
allow 源类型 目标类型:访问类型 {操作权限};
eg:
avc: denied { 操作权限 } for pid=26382 comm=“进程名”
scontext=u:r:源类型:s0 tcontext=u:r:目标类型:s0
tclass=访问类型 permissive=0
allow 源类型 目标类型:访问类型 {操作权限};
allow system_server sysfs_xw_hw_info:file { getattr };
avc: denied { getattr } for path="/sys/machine/info/lcm_info" dev="sysfs" ino=44088 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_xw_hw_info:s0 tclass=file permissive=0
avc: denied { getattr } for path="/sys/machine/info/tp_id" dev="sysfs" ino=44089 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_xw_hw_info:s0 tclass=file permissive=0
avc: denied { getattr } for path="/sys/machine/info/tp_fw" dev="sysfs" ino=44090 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_xw_hw_info:s0 tclass=file permissive=0
avc: denied { getattr } for path="/sys/machine/info/back_camera_info" dev="sysfs" ino=44091 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_xw_hw_info:s0 tclass=file permissive=0
avc: denied { getattr } for path="/sys/machine/info/front_camera_info" dev="sysfs" ino=44092 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_xw_hw_info:s0 tclass=file permissive=0