解决方案:

首先将我们的报错avc日志拷出来做成一个avc.txt放在Ubuntu系统下面在终端中运行以下命令生成的avc.te文件就是我们的解决方法了。

audit2allow –i avc.txt >avc.te

avc.txt

avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0
avc: denied { create } for name="hsdi_tmp" scontext=u:r:system_app:s0 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0

运行audit2allow工具(external/selinux/prebuilts/bin/audit2allow)之后得到的avc.te文件

avc.te

#============= system_app ==============
allow system_app protect_f_data_file:dir create;

前面的#============= system_app ==============

就是在告诉你在那个文件里面,你可以找到你们系统真正起作用的system_app.te文件是那个目录的。然后在文件的末尾处添加里面的那句话

allow system_app protect_f_data_file:dir create;

注意 这个权限问题是要一个个慢慢来的,也就是说你这个权限加了 等会你运行进去还有可能出现其他的权限问题。这就需要大家要有耐心慢慢的去一个个加好。

有的时候权限明明加进去了却还是报相同的错误 这个时候你就得检查你是否加对地方了。

把你编译的这个文件拷贝出来

out/target/product/angler/obj/ETC/sepolicy.recovery_intermediates/policy_recovery.conf

SELinux audit2allow命令使用相关推荐

  1. linux命令关闭电脑,SELinux关闭命令详解linux操作系统 -电脑资料

    下面来给大家介绍在linux中SELinux关闭方法吧,如果你正在了解这个可以来参考此文章,文章重点介绍了SELinux的使用方法哦, 关闭SELinux的方法: 修改/etc/selinux/con ...

  2. SELinux 基础命令

    检查SELinux是否已经启用. [root@localhost ~]# sestatus SELinux status:  disabled 常用命令如下: sestatus 查询系统的selinu ...

  3. SELinux处理命令

    1 查看SELinux状态 Enforcing为开启状态:Disabled为关闭状态. [root@localhost /]# getenforce Enforcing 2 临时关闭SELinux [ ...

  4. SELinux avc权限--audit2allow

    SELinux avc 权限, audit2allow 使用 若在log出现" avc:"则按照调试添加权限. 使用avc关键词查找权限相关log adb logcat -b al ...

  5. Linux下 启动SELinux命令,Linux下查看SELinux状态和关闭SELinux的方法命令是什么

    Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统.对于SELinux状态可能很多用户不知道怎么设置,这篇文章主要介绍了Linux下查看SELinux状态和关闭SELi ...

  6. 鸟哥的Linux私房菜(基础篇)- 第十七章、程序管理与 SELinux 初探

    第十七章.程序管理与 SELinux初探 最近升级日期:2009/09/11 一个程序被加载到内存当中运行,那么在内存内的那个数据就被称为程序(process).程序是操作系统上非常重要的概念,所有系 ...

  7. android audit2allow工具使用步骤

    在dmesg里面经常会看到很多的avc denied的打印,如果有很多这种打印,那可以借助于android提供的audit2allow工具帮我们转换成allow语句. 使用步骤如下: 一.将dmesg ...

  8. 18. SELinux管理

    root 用户实在是一个超人,它在 Linux 系统当中就是无所不能的,而且读.写和执行权限对 root 用户完全没有作用.root 用户的存在极大地方便了 Linux 的管理,但是也造成了一定的安全 ...

  9. SELinux 的工作模式(Disabled、Permissive和Enforcing)

    通过对 SELinux 的介绍,初学者可以这样认为,在传统 Linux 系统使用访问控制方式的基础上,附加使用 SELinux 可增强系统安全. 那么,SELinux 是如何运行的呢? 在解释 SEL ...

  10. Linux -- SELinux配置及应用(1)

    一.SELinux 与强制访问控制系统 SELinux 全称 Security Enhanced Linux (安全强化 Linux),是 MAC (Mandatory Access Control, ...

最新文章

  1. webstrom代码检查
  2. 解决vnc灰屏,黑屏,鼠标大黑叉情况
  3. TCP/IP UDP用户数据报协议 运输层
  4. Java机器学习库ML之七分类预测输出概率值
  5. python爬虫模块取cookie_[ Python爬虫实战 ] Python使用cookies - pytorch中文网
  6. 使用jQuery操作input的value值
  7. emacs c语言 自动补全,Emacs 与 C/C++ 代码自动补全
  8. 用python爬虫爬取无水印图片_使用python 爬虫,爬取图片
  9. 分布式Session的几种实现方式
  10. 软件技术基础_前端系列课程(7)-软件技术基础
  11. 苹果被曝寻求收购Drive.ai:吴恩达参与运营,多家中国VC投资
  12. SQLite指南(5) - PRAGMA命令用法(完整)
  13. win10计算机用户文件夹改名字怎么改,win10如何改成自己想要的文件夹用户名
  14. 2008新建域时失败问题
  15. Python 指定区域截图
  16. 概念数据模型、逻辑数据模型、物理数据模型详解
  17. udp简单通讯示例---心跳示例
  18. Codeforces Global Round 16 D2. Seating Arrangements (hard version)
  19. 清除keep-alive缓存,动态缓存
  20. ShareX的使用说明

热门文章

  1. kettle日志解析_Kettle日志-基础篇
  2. c语言无符号数最大值和最小值,c语言 int最大值是多少?
  3. 【你也能看得懂的电磁场与电磁波系列连载 12】
  4. border属性的三要素
  5. 请和我一起学习机器学习算法(高斯混合聚类)
  6. Django ORM模型一对一、一对多、多对多的操作详解
  7. 格式化输出函数setw与setfill的使用
  8. JAVA实现浪漫流星表白(520到了,快来看看程序员是怎么表白的吧)
  9. 如何制作Excel表头
  10. java 实现session的退出登录