一般的权限修改
avc: denied { read write } for comm="microcom" name="ttyUSB3" dev="tmpfs" ino=16370 scontext=u:r:shell:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file permissive=1
修改方法:
allow shell radio_device:chr_file { read write };
带ioctlcmd的权限采用上面的修改,有时会出现无效的情况,需要使用如下方法修改
avc: denied { ioctl } for comm="ifconfig" path="socket:[56580]" dev="sockfs" ino=56580 ioctlcmd=0x8927 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=udp_socket permissive=0
修改方案
allowxperm shell self:udp_socket ioctl { 0x8927 };
强制永久关闭selinux权限
在system/core/init/selinux.cpp文件中
在bool IsEnforcing() 函数中
改成 return ture;