3

我曾经能够在我的 Nexus 6 上运行 systrace,但最近它停止工作(可能是在最近的每月更新之一之后):systrace 挂起,试图从我的设备上下载跟踪。

adb logcat,我看到一堆像

05-26 14:57:08.567  4933  4933 W <my.app.package>: type=1400 audit(0.0:23388710): avc: denied { getattr } for comm=66627379737472616365206E6F7469 path="/sys/kernel/debug/tracing/trace" dev="debugfs" ino=4158 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:debugfs:s0 tclass=file permissive=0

我知道 systrace 使用debugfs,这似乎是 SELinux 权限问题(请参阅https://source.android.com/security/selinux/validate.html)。有没有人让这个再次工作?

4

1 回答 1

0

这是设计使然。Debugfs 中有很多有害的部分,因此拆分为 tracefs。有关更多信息,这些文章很方便:

在 AOSP 的 system/sepolicy 中,可以找到 neverallows:

96b1c9ca (Nick Kralevich 2015-12-17 16:38:21 -0800 564) neverallow { domain -init -system_server -dumpstate } debugfs:file no_rw_file_perms;

以及阅读 untrusted_app (上面已涵盖并且似乎是多余的):

$ git blame -L106,106 untrusted_app.te
96b1c9ca (Nick Kralevich 2015-12-17 16:38:21 -0800 106) neverallow untrusted_app debugfs_type:file read;

顺便说一句,如果你得到十六进制编码的通信字段,可以使用 Python 像这样解码它们:

'66627379737472616365206E6F7469'.decode('hex')
'fbsystrace noti
于 2016-06-13T19:32:23.873 回答