【发布时间】:2016-06-22 15:57:49
【问题描述】:
在 AOSP 构建中,我收到了以下 avc 被拒绝的消息,
01-01 00:01:28.600 1458-1458/? W/iw﹕ type=1400 audit(0.0:5): avc: denied { create } for scontext=u:r:system_app:s0 tcontext=u:r:system_app:s0 tclass=netlink_socket permissive=0
01-01 00:01:28.660 1460-1460/? W/ndc﹕ type=1400 audit(0.0:6): avc: denied { write } for name="netd" dev="tmpfs" ino=1575 scontext=u:r:system_app:s0 tcontext=u:object_r:netd_socket:s0 tclass=sock_file permissive=0
01-01 00:01:28.720 1461-1461/? W/ndc﹕ type=1400 audit(0.0:7): avc: denied { write } for name="netd" dev="tmpfs" ino=1575 scontext=u:r:system_app:s0 tcontext=u:object_r:netd_socket:s0 tclass=sock_file permissive=0
01-01 00:01:28.790 1462-1462/? W/ndc﹕ type=1400 audit(0.0:8): avc: denied { write } for name="netd" dev="tmpfs" ino=1575 scontext=u:r:system_app:s0 tcontext=u:object_r:netd_socket:s0 tclass=sock_file permissive=0
01-01 00:01:28.860 1463-1463/? W/ndc﹕ type=1400 audit(0.0:9): avc: denied { write } for name="netd" dev="tmpfs" ino=1575 scontext=u:r:system_app:s0 tcontext=u:object_r:netd_socket:s0 tclass=sock_file permissive=0
使用audit2allow 我得到了关注
allow system_app netd_socket:sock_file write;
allow system_app self:netlink_socket create;
我已将相同内容添加到device/<vendor-path>/sepolicy/system_app.te
还从neverallow 政策中排除了系统应用程序,如下external/sepolicy/app.te
neverallow { appdomain -system_app }
self:{
netlink_socket
netlink_firewall_socket
netlink_tcpdiag_socket
netlink_nflog_socket
netlink_xfrm_socket
netlink_audit_socket
netlink_ip6fw_socket
netlink_dnrt_socket
} *;
但仍然获得相同的权限被拒绝 avc 日志。
【问题讨论】:
-
您在更改 te 文件后是否遇到完全相同的审核失败?
-
你是如何重建和部署的?检查设备上@987654328@ 的大小/校验和可能是值得的,以确保您的更改正在传播到 initramfs。