1. 从logcat中过滤avc信息
avc: denied { read write } for comm="vendor.demo" name="ttyHW5" dev="tmpfs" ino=610 scontext=u:r:hal_gnss_default:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
avc: denied { ioctl } for comm="vendor.demo" path="/dev/ttyHW5" dev="tmpfs" ino=610 ioctlcmd=0x5401 scontext=u:r:hal_gnss_default:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
avc: denied { ioctl } for comm="vendor.demo" path="/dev/ttyHW5" dev="tmpfs" ino=610 ioctlcmd=0x5401 scontext=u:r:hal_gnss_default:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
2. 从avc中配置相关规则
allow hal_gnss_default device:chr_file rw_file_perms;
但上面的规则无法生效。如上规则,放在系统里编译,会出现如下错误:
libsepol.report_failure: neverallow on line 681

最低0.47元/天 解锁文章
2465

被折叠的 条评论
为什么被折叠?



