android apk权限 linux,Android SeLinux权限问题和解决方法

目标类型”

如:在file_contexts中添加:/dev/tfa9890u:object_r:audio_device:s0

3.4 举例

添加权限:

在mediaserver.te中添加allow mediaserver device:chr_file { read write open};

编译报错:

libsepol.check_assertion_helper: neverallow on line 258 ofexternal/sepolicy/domain.te (or line 5252 of policy.conf) violated byallow mediaserver device:chr_file { read write open};

违反了domain.te 258的:

neverallow {domain –unconfineddomain –ueventd } device:chr_file { open read write}

运行Log:

avc: denied { read write } for pid=303 comm=”mediaserver”name=”tfa9890″ dev=”tmpfs” ino=3880 scontext=u:r:mediaserver:s0 tcontext=u:object_r:device:s0tclass=chr_file permissive=0

修改步骤:

1.目标名称是: tfa9890, 其在系统中的路径是: /dev/tfa9890, 是audio相关的设备文件

2.源类型是mediaserver, 在mediaserver.te 文件中发现其具有 audio_device 目标类型的权限

3.所以在file_contexts 中添加 “/dev/tfa9890 u:object_r:audio_device:s0” 可以解决问题

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值