AVC 报错问题示例以及解决方案
AVC 报错问题示例以及解决方案
1. AVC报错实例:
Line 4832: 12-28 10:33:21.680000 1726 1726 I rild : type=1400 audit(0.0:59): avc: denied { execute } for name="pppd" dev="dm-0" ino=357 scontext=u:r:rild:s0 tcontext=u:object_r:ppp_exec:s0 tclass=file permissive=1Line 4833: 12-28 10:33:21.680000 1726 1726 I rild : type=1400 audit(0.0:60): avc: denied { read open } for path="/system/bin/pppd" dev="dm-0" ino=357 scontext=u:r:rild:s0 tcontext=u:object_r:ppp_exec:s0 tclass=file permissive=1Line 4834: 12-28 10:33:21.680000 1726 1726 I rild : type=1400 audit(0.0:61): avc: denied { execute_no_trans } for path="/system/bin/pppd" dev="dm-0" ino=357 scontext=u:r:rild:s0 tcontext=u:object_r:ppp_exec:s0 tclass=file permissive=1Line 4835: 12-28 10:33:21.690000 1726 1726 I pppd : type=1400 audit(0.0:62): avc: denied { getattr } for path="/system/bin/pppd" dev="dm-0" ino=357 scontext=u:r:rild:s0 tcontext=u:object_r:ppp_exec:s0 tclass=file permissive=1Line 4835: 12-28 10:33:21.690000 1726 1726 I pppd : type=1400 audit(0.0:62): avc: denied { getattr } for path="/system/bin/pppd" dev="dm-0" ino=357 scontext=u:r:rild:s0 tcontext=u:object_r:ppp_exec:s0 tclass=file permissive=1Line 4838: 12-28 10:33:21.700988 1726 1726 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 4839: 12-28 10:33:21.701056 1726 1726 E pppd : Sorry - this system lacks PPP kernel supportLine 4889: 12-28 10:33:58.118905 1734 1734 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 4890: 12-28 10:33:58.119129 1734 1734 E pppd : Sorry - this system lacks PPP kernel supportLine 4923: 12-28 10:34:01.373867 1735 1735 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 4924: 12-28 10:34:01.374034 1735 1735 E pppd : Sorry - this system lacks PPP kernel supportLine 4925: 12-28 10:34:04.626659 1736 1736 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 4926: 12-28 10:34:04.626895 1736 1736 E pppd : Sorry - this system lacks PPP kernel supportLine 4927: 12-28 10:34:07.936232 1737 1737 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 4928: 12-28 10:34:07.936401 1737 1737 E pppd : Sorry - this system lacks PPP kernel supportLine 9884: 12-28 10:34:44.255467 1793 1793 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 9885: 12-28 10:34:44.255550 1793 1793 E pppd : Sorry - this system lacks PPP kernel supportLine 9886: 12-28 10:34:44.250000 1793 1793 I pppd : type=1400 audit(0.0:64): avc: denied { read write } for name="ppp" dev="tmpfs" ino=9126 scontext=u:r:rild:s0 tcontext=u:object_r:ppp_device:s0 tclass=chr_file permissive=1Line 9887: 12-28 10:34:44.250000 1793 1793 I pppd : type=1400 audit(0.0:65): avc: denied { open } for path="/dev/ppp" dev="tmpfs" ino=9126 scontext=u:r:rild:s0 tcontext=u:object_r:ppp_device:s0 tclass=chr_file permissive=1Line 10713: 12-28 10:34:47.502166 1794 1794 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 10714: 12-28 10:34:47.502406 1794 1794 E pppd : Sorry - this system lacks PPP kernel supportLine 11286: 12-28 10:34:50.770849 1807 1807 E pppd : Couldn't open the /dev/ppp device: Operation not permittedLine 11287: 12-28 10:34:50.771091 1807 1807 E pppd : Sorry - this system lacks PPP kernel supportLine 11739: 12-28 10:34:54.087086 1809 1809 E pppd : Couldn't open the /dev/ppp device: Operation not permitted
2.如何消除这样的不通过
上处avc不通过,可以在/external/sepolicy/ 目录下,新建一个test.te
在test.te 中写入,allow rmt kmem_device:chr_file {read write},
重新编译策略语言,刷机即可;
但是当avc很多时,人工去看容易出错且慢,我们可以使用工具来完成这项工作;
selinux/policycoreutils/audit2allow环境搭建:
测试电脑的配置是:unbutu 12.04
step 1:在 ubuntu中安装policycoreutils
sudo apt-get install policycoreutils
step 2 : 使用audit2allow 工具完成策略语言:
audit2allow -i filename
例如上诉avc语句就会输出:
#============= mobile_log_d ==============
allow mobile_log_d mtk_em_ril_apnchange_prop:file { getattr open };
allow mobile_log_d sys_rpmb_ready_prop:file { getattr open };#============= rild ==============
allow rild system_data_file:file write;#============= untrusted_app ==============
allow untrusted_app anr_data_file:dir read;
allow untrusted_app debugfs:dir { read open };
allow untrusted_app debugfs:file { read getattr open };
allow untrusted_app device_logging_prop:file { getattr open };
allow untrusted_app mmc_prop:file { getattr open };
allow untrusted_app mtk_em_ril_apnchange_prop:file { getattr open };
allow untrusted_app safemode_prop:file { getattr open };
allow untrusted_app sys_rpmb_ready_prop:file { getattr open };
allow untrusted_app sysfs:file { read getattr open };
把生成的语言添加到对应的 te文件中,重新编译验证。
AVC 报错问题示例以及解决方案相关推荐
- @Autowired报错的4种解决方案和原因分析!
作者 | 王磊 来源 | Java中文社群(ID:javacn666) 转载请联系授权(微信ID:GG_Stone) 上图的报错信息相信大部分程序员都遇到过,奇怪的是虽然代码报错,但丝毫不影响程序的正 ...
- vue 项目在index.html页面直接引入jq库,报错$ is not defined解决方案
近日在vue项目开发中遇到一个问题:vue 项目在index.html页面直接引入jq库,报错$ is not defined解决方案... 首先说一下为什么会出现这个错误,其实项目发布到线上是不会出 ...
- 0x0报错解决--win11预览版升级报错0x0的快速解决方案
win11预览版升级报错0x0的快速解决方案 一 问题确认 二 问题原因 三 修复方案 四 安装注册表 一 问题确认 升级win11预览版时,提示0x0报错 二 问题原因 系统缺少系统服务相关的注册表 ...
- Python爬虫总结——常见的报错、问题及解决方案
Python爬虫基础--HTML.CSS.JavaScript.JQuery网页前端技术 Python爬虫基础--正则表达式 Python爬虫基础--re模块的提取.匹配和替换 Python爬虫基础- ...
- uni-app报错 caniuse-lite is outdated 解决方案
uni-app的项目运行时莫名开始报错如上图,解决方案: 找到uni-app文件夹如下目录: \HBuilderX\plugins\uniapp-cli 启动命令行运行:npx browserslis ...
- 关于Windows Server自动重启,并出现日志报错WHEA-Logger 47错误解决方案
关于Windows Server自动重启,并出现日志报错WHEA-Logger 47错误解决方案 参考文章: (1)关于Windows Server自动重启,并出现日志报错WHEA-Logger 47 ...
- Mybatis报错mapkey is required解决方案
Mybatis报错mapkey is required解决方案 问题背景 解决方案 总结 Lyric: 几天都没有喝水也能活 问题背景 因为使用了mybatisX插件,导致检查报错mapkey is ...
- Android Selinux avc报错分析
avc权限报错 E SELinux : avc: denied { find } for interface=vendor.qti.hardware.perf::IPerf sid=u:r:media ...
- linux svn e170001,jenkins - svn: E170001报错的原因以及解决方案
1. 什么问题What? 使用Jenkins配置的svn拉取项目,Jenkins报错:svn: E170001; Your credentials to connect to the reposito ...
最新文章
- CVPR 2021 | 基于帧场学习的多边形建筑提取
- 常见被病毒利用的漏洞补丁
- IO流介绍、java常用的几个IO流类之间的区别,以及各自的用法、使用场景
- c和python的区别动图_C语言与Python 对程序员的差别到底在哪?
- 【蓝桥杯真题】地宫取宝(搜索-记忆化搜索详解)
- selenium实现失败重运行
- 完善的WebGis地图编辑器
- 轻松几步完成cisco交换机配置全是干货!
- VMware VCenter Converter Standalone 6.2.0下载地址
- 什么软件可以编辑PDF,PDF怎么拆分页面
- java 3des解密_Java进行3DES加密解密详解
- Presto Facebook 开源的大数据查询引擎
- Vue中实现页面截图并上传
- 云计算与虚拟化技术【课堂笔记】
- 基于单片机的水壶自动加热系统_一种基于单片机的电热水壶控制系统的制作方法...
- 【基础知识】Dom基础
- 公网与私网地址转换——NAT技术的使用小技巧,超简单!!!
- 解决win10设备管理器及操作找不到蓝牙
- 尴尬了!一个妹子 rm -rf 把公司整个数据库删没了...
- 实习第一天——网宿报到日
热门文章
- 双管齐下,JDK源码+HotSpot源码一次性学完
- 数据分析实战项目3-用Excel做RFM模型用户分层模型分析
- python 学习笔记(下)
- python清除非英文和中文的字符
- linux 增加环回接口,linux环回接口到python中的特定接口
- 已修复最新固件问题Surface Pro 6 安装黑苹果15.6 完美版,触控板、显卡、声音、USBWiFi驱动,一步到位懒人必备--(原创)杨泽鹏
- html5闪光字效果,如何使用css3+html5来制作文字霓虹灯效果(付完整代码)
- struts 国际化 中文编码问题
- python的pycrypto模块安装和使用
- Latex入门+视频教程