简体   繁体   中英

SELinux Unix Socket permission denied. How to fix?

I have modified bluedroid to include a small unix socket server for reasons.

When client starts, I see that SElinux doesn't like it, and throws out this:

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

This socket does not have a real path. How do I add SELinux rule to allow this socket?

Update

Tried audit2allow as mentioned by Google here

Got errors.

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

I have no real experience in SELinux, so I am pretty much stuck here.

The error was:

policydb version 30 does not match my version...

This error was generated by audit2allow installed with apt-get. It is resolved by using audit2allow found in the AOSP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM