[SDM660 Android9.0]selinux权限

1.apk控制gpio init.qcom.rc里给该io 666权限 也不能操控
操控报错
应用层

5244  5244 W ing.aliveDetect: type=1400 audit(0.0:183): avc: denied { write } for name="value" dev="sysfs" ino=50119 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
01-01 11:35:58.009  6036  6036 W System.err: java.io.FileNotFoundException: /sys/class/gpio/gpio73/value (Permission denied)
1970-01-01 08:12:21.489 7430-7430/com.joyusing.aliveDetect W/Thread-3: type=1400 audit(0.0:77): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=18765 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
1970-01-01 08:12:21.489 7430-7430/com.joyusing.aliveDetect W/Thread-4: type=1400 audit(0.0:78): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=18765 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0

kernel层

[   96.905634] type=1400 audit(979.869:171): avc: denied { write } for pid=5244 comm="ing.aliveDetect" name="value" dev="sysfs" ino=50119 scontext=u:r:untrust
ed_app_25:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
[   97.032123] type=1400 audit(979.869:171): avc: denied { write } for pid=5244 comm="ing.aliveDetect" name="value" dev="sysfs" ino=50119 scontext=u:r:untrust
ed_app_25:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

解决:
上层配置:setenforce 0
后续再打开apk操控io正常

sdm660_64:/ # getenforceEnforcingsdm660_64:/ #sdm660_64:/ #sdm660_64:/ # setenforce 0sdm660_64:/ # getenforcePermissivesdm660_64:/ #

缺少什么权限: { write}权限,
谁缺少权限: scontext=u:r:untrusted_app_25:s0:c512
对哪个文件缺少权限:tcontext=u:object_r:sysfs:s0
什么类型的文件: tclass= file
完整的意思: u:r:untrusted_app_25 进程对sysfs类型的file缺少write权限
解决:
device/qcom/sepolicy/vendor/sdm660/system_server.te添加:allow untrusted_app_25 sysfs:file rw_file_perms


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部