添加文件的SELinux权限

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

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值