android avc 实例分析
我们需要读取/proc/driver/rearsensor2 下的数据avc:错误如下avc: denied { read } for name="rearsensor2" dev="proc" ino=4026532339 scontext=u:r:em_svr:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=0谁缺少权限 sc...
·
我们需要读取/proc/driver/rearsensor2 下的数据
avc:错误如下
avc: denied { read } for name="rearsensor2" dev="proc" ino=4026532339 scontext=u:r:em_svr:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=0
谁缺少权限 scontext=u:r:em_svr:s0 #em_svr
对什么缺少权限:tcontext=u:object_r:proc:s0 #proc
缺少什么权限:denied { read } #read
什么类型的权限:tclass=file#file
修改如下
找到em_svr.te,添加如下
allow em_svr proc:file { read };
上面编译时报错的在system 中的domain.te中有个重复的定义
修改如下:
找到genfs_contexts 文件添加
#sun:jicong.wang
genfscon proc /driver/rearsensor2 u:object_r:proc_driver_rearsensor2:s0
#sun:jicong.wang end
file.te中添加
#sun:jicong.wang add
type proc_driver_rearsensor2, fs_type, proc_type;
然后在em_svr.te文件中,添加
allow em_svr proc_driver_rearsensor2:file { read };
更多推荐
已为社区贡献50条内容
所有评论(0)