gpt4 book ai didi

android - 即使添加了适当的策略,avc 仍被拒绝

转载 作者:行者123 更新时间:2023-11-30 01:15:03 24 4
gpt4 key购买 nike

在 AOSP 构建中,我收到以下 avc denied 消息,

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 日志。

最佳答案

从您的更改中看不出任何错误。假设您的 sepolicy 更改没有构建到内核中。
请尝试 make kernelclean 并在以下文件中重建内核 vim:

out/target/product/xxxx/obj/ETC/sepolicy_intermediates/policy.conf

所有的sepolicy应该在policy.conf中,grep你新添加的policy来检查它是否已经被编译到内核中。

关于android - 即使添加了适当的策略,avc 仍被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37973039/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com