Android(安卓)出现 avc: denied { execmod }如何处理?
16lz
2021-01-25
内置应用会出现各种问题,不过内置应用会出现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=011-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就可以了~
更多相关文章
- 一款常用的 Squid 日志分析工具
- GitHub 标星 8K+!一款开源替代 ls 的工具你值得拥有!
- RHEL 6 下 DHCP+TFTP+FTP+PXE+Kickstart 实现无人值守安装
- Linux 环境下实战 Rsync 备份工具及配置 rsync+inotify 实时同步
- armeabi和armeabi-v7a
- 使用SVN管理Android工程
- Android(安卓)Launcher3 禁止用户拖动图标创建文件夹,控制拖动图
- Android学习之RecyclerView
- 缓存统一管理工具类--android