NDK-Socket-IPC icon indicating copy to clipboard operation
NDK-Socket-IPC copied to clipboard

UDS might not work on Android10

Open ylz-at opened this issue 3 years ago • 4 comments

I tried to copy-paste the code of the UDS server part and test it on Android 10 (device: Note20 Ultra), and got the error: bind Read-only file system.

        minSdkVersion 29
        targetSdkVersion 30

Could you please try to update the demo and see if it works on API level >=29?

ylz-at avatar Mar 11 '21 06:03 ylz-at

My bad... Yes, it works on Android10

I typed

strncpy(server_addr.sun_path, socket_name, sizeof(server_addr.sun_path) - 1);

as

strncpy(server_addr.sun_path, SOCKER_NAME, sizeof(server_addr.sun_path) - 1);

lol

ylz-at avatar Mar 11 '21 06:03 ylz-at

not really works on the client-side.

2021-03-11 15:55:54.637 22278-22278/com.example E/example: connect: Permission denied
2021-03-11 15:40:18.528 749-749/? E/audit: type=1400 audit(1615448418.523:10804): avc:  denied  { connectto } for  pid=20579 comm="ase.example" path=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 scontext=u:r:untrusted_app:s0:c16,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c17,c257,c512,c768 tclass=unix_stream_socket permissive=0 SEPF_SM-N986U_10_0019 audit_filtered

ylz-at avatar Mar 11 '21 07:03 ylz-at

Yes, it seems that so module need group authority to connect uds

frankgogoland avatar Jun 03 '21 08:06 frankgogoland

how to solve this problem?

ouclbc avatar Mar 15 '23 07:03 ouclbc