Android SELinux avc denied解决

参考:Android SELinux avc dennied权限问题解决方法

 

解决原则:缺什么权限补什么,直到没有avc denied为止。

解决方法:在对应的.te中增加allow语句。

 

格式一般如下:

avc: denied { 操作权限 } for pid=7201 comm=“进程名” scontext=u:r:源类型:s0 tcontext=u:r:目标类型:s0 tclass=访问类型 permissive=0 

 

案例:

audit: type=1400 audit(1113.763:288): avc:  denied  { write } for  pid=328 comm="fastbootd" name="mmcblk0p29" dev="tmpfs" ino=7915 scontext=u:r:fastbootd:s0 tcontext=u:object_r:mmcblk_device:s0 tclass=blk_file permissive=1

scontext和tcontext都是安全上下文,分别称为主体和客体,主体一般都是进程,客体则是主体访问的资源。

缺少什么权限:               { write }权限,

谁缺少权限:                    scontext=u:r:fastbootd:s0

对哪个资源缺少权限:     tcontext=u:object_r:mmcblk_device:s0

什么类型的资源:            tclass=blk_file

完整的意思: fastbootd进程对mmcblk_device类型的blk_file缺少write权限。

 

解决方法:在fastbootd.te文件(若没有则添加)加入内容:

     allow fastbootd mmcblk_device:blk_file { read write getattr open ioctl };

即允许fastbootd对mmcblk_device类型的blk_file进行read/write/ioctl等操作。

  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值