【问题标题】:SELinux Unix Socket permission denied. How to fix?SELinux Unix 套接字权限被拒绝。怎么修?
【发布时间】: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


【解决方案1】:

错误是:

policydb version 30 does not match my version...

这个错误是由使用 apt-get 安装的 audit2allow 产生的。 可以使用 AOSP 中的 audit2allow 解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-12-22
    • 2016-02-25
    • 2014-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多