Android 出现 avc: denied { execmod }如何处理?

内置应用会出现各种问题,不过内置应用会出现avc报错到还是第一次,报错如下:

11-21 11:20:18.427  6603  6603 W tudent.activity: type=1400 audit(0.0:51): avc: denied { execmod } for path="/system/app/education_student/lib/arm/libhpHandPends.so" dev="mmcblk0p24" ino=424 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:system_file:s0 tclass=file permissive=0
11-21 11:20:18.437  6603  6603 W linker  : /system/app/education_student/lib/arm/libhpHandPends.so has text relocations. This is wasting memory and prevents security hardening. Please fix.

其他的so文件都没有错误,只有这个so出现错误,而且手动安装也不会出现问题,下面只好修改te文件来解决这个问题了

denied后面{}里的是要执行的动作,比如append,open,execmod,link等等

scontext指的是域,对应的是te文件 上面报错这条对应te文件是untrusted_app.te,scontext全写是source_type context;

tcontext指的是目标类型,上面报错这条对应的是目标类型system_file,tcontext全写是target_type context;

tclass指的是类别,上面报错这条对应的是类别是file,

te表达式格式:
rule_name:规则名称,除了有allow还有dontaudit,auditallow和neverallow
source_type:源类型,对应一个很重要的概念--------域(domain)
tartget_type:目标的类型,即安全上下文,SELinux一个重要的判断对象
class:类别,目标(客体)是哪种类别,主要有File,Dir,Socket,SEAndroid还有Binder等,在这些基础上又细分出设备字符类型(chr_file),链接文件(lnk_file)等。可以通过ls -l查看文件类型
perm_set:动作集

下面在selinux中添加上这条,找到untrusted_app.te文件,路径是system/core/rootdir/untrusted_app.te,然后加上

allow untrusted_app system_file:file execmod;

然后只需要编译boot.img就可以了~


 

猜你喜欢

转载自blog.csdn.net/lancelots/article/details/84399042