Android SELinux avc:denied报错模板通用修改策略

报错模板:

avc: denied { read write getattr } for pid=3944 comm="handsetpowerlib" name="xxxx" dev="tmpfs" ino=5545 scontext=u:r:AAA:s0:c512,c768 tcontext=u:object_r:BBB:s0 tclass=CCC permissive=1


信息提取:

主体:AAA

客体:BBB

客体类别:CCC

需要allow的权限:read write getattr


修改策略:

1、增加主体新类型(如果不存在)te文件

devices/vendorxxx/sepolicy/common/下新增AAA.te:

type AAA, domain,mlstrustedsubject;  #mlstrustedsubject看情况决定是否添加

扫描二维码关注公众号,回复: 12499556 查看本文章

type AAA_exec, exec_type,,file_type; 

init_daemon_domain(AAA)

allow AAA BBB:CCC read write getattr };

allow .....;       #添加其他avc:denied

2、修改file_contexts

devices/vendorxxx/sepolicy/common/file_contexts新增:

/.../AAA  u:object_r:AAA_exec:s0 #/.../AAA为AAA的绝对路径

猜你喜欢

转载自blog.csdn.net/qq_33611327/article/details/114085637