【发布时间】:2020-10-15 21:05:05
【问题描述】:
我的 android 的 logcat 收到这些警告的垃圾邮件。(以 magisk 为根)
10-15 22:02:29.039 12944 12944 W kworker/0:4: type=1400 audit(0.0:87190): avc: denied { read write } for name="sde73" dev="tmpfs" ino=28978 scontext=u:r:kernel:s0 tcontext=u:object_r:oem_device:s0 tclass=blk_file permissive=0
我正在查看以下文档以了解如何解决此问题,但无法解决。
https://source.android.com/security/selinux/device-policy
https://source.android.com/security/selinux/validate
https://source.android.com/security/selinux/concepts
https://source.android.com/security/selinux/implement
https://gist.github.com/msfjarvis/ec52b48eb2df1688b7cbe32bcd39ee5f
https://source.android.com/security/selinux/customize#android-o
https://topjohnwu.github.io/Magisk/tools.html#magiskpolicy
https://topjohnwu.github.io/Magisk/details.html#magisk-booting-process
https://topjohnwu.github.io/Magisk/guides.html#boot-scripts
我查看了/dev,但我没有类似的东西。
android# ls -l /dev/ | grep sd
#returns nothing
inode 解析到这个文件:
find /sys -xdev -inum 28978
/sys/firmware/devicetree/base/__symbols__/sb_7_tx
但是在下次重新启动时会解析到其他文件,但错误总是与单个 inode 相关。
我想我应该将此规则添加到 .te 文件中
allow kernel oem_device:blk_file {read write};
adb pull /sys/fs/selinux/policy
adb logcat -b all -d | audit2allow -p policy
#this confirms the rule
我在这个转储中找到了一些与 selinux 相关的文件:
但我不太确定我应该在哪里添加规则..可能在 /vendor/etc/selinux..的某个地方..
有谁知道修复这些警告的步骤是什么,并可能进一步深入调查为什么它们首先会出现?
谢谢
【问题讨论】: