我曾经可以在我的Nexus6上运行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)。有没有人把这玩意修好了?
发布于 2016-06-14 03:32:24
这是设计好的。Debugfs中有很多不安全的部分,因此拆分成tracef。要了解更多信息,这些文章很方便:
在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;顺便说一下,如果你得到十六进制编码的comm字段,你可以这样解码它们,使用Python:
'66627379737472616365206E6F7469'.decode('hex')
'fbsystrace notihttps://stackoverflow.com/questions/37463159
复制相似问题