【发布时间】:2016-05-27 06:23:56
【问题描述】:
出于某种原因,我已修改 bluedroid 以包含一个小型 unix 套接字服务器。
当客户端启动时,我看到 SElinux 不喜欢它,并抛出这个:
05-26 18:01:41.072 6248-6248/? I/com.gps.uclient: type=1400 audit(0.0:20): avc: denied { connectto } for path=00236264726F696468696472617773727663 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:bluetooth:s0 tclass=unix_stream_socket permissive=1
这个套接字没有真正的路径。如何添加 SELinux 规则以允许此套接字?
更新
尝试了 Google here 提到的 audit2allow
出现错误。
gps@gps-HP-ProBook-4540s:~$ audit2allow -i sedeny.txt -p ./andsrc/android-6.0.1_r25/out/target/product/flo/root/sepolicy
libsepol.policydb_read: policydb version 30 does not match my version range 15-29
libsepol.context_from_record: user u is not defined
libsepol.context_from_record: could not create context structure
libsepol.context_from_string: could not create context structure
libsepol.sepol_context_to_sid: could not convert u:r:untrusted_app:s0:c512,c768 to sid
我没有真正的 SELinux 经验,所以我几乎被困在这里。
【问题讨论】:
-
请找到有关如何使用 audit2allow 的完整详细文档。 wiki.centos.org/HowTos/SELinux 搜索:7. 使用 audit2allow 创建自定义 SELinux 策略模块
标签: android selinux unix-socket