Asutorufa / tailscaled-socks5-android

userspace-networking tun mode for android that mutiple vpn service used
2 stars 1 forks source link

Crashes on start due to seccomp #1

Closed gbraad closed 1 week ago

gbraad commented 1 month ago

When pressing [start], the application immediately crashes. adb logcat shows:

10-02 13:41:09.622 18968 18968 F DEBUG   : Build fingerprint: 'samsung/crownqltezh/crownqltechn:10/QP1A.190711.020/N9600ZHU9FVG2:user/release-keys'
10-02 13:41:09.622 18968 18968 F DEBUG   : Revision: '11'
10-02 13:41:09.622 18968 18968 F DEBUG   : ABI: 'arm64'
10-02 13:41:09.623 18968 18968 F DEBUG   : Timestamp: 2024-10-02 13:41:09+0800
10-02 13:41:09.623 18968 18968 F DEBUG   : pid: 18934, tid: 18960, name: rufa.tailscaled  >>> io.github.asutorufa.tailscaled <<<
10-02 13:41:09.623 18968 18968 F DEBUG   : uid: 10898
10-02 13:41:09.623 18968 18968 F DEBUG   : signal 31 (SIGSYS), code 1 (SYS_SECCOMP), fault addr --------
10-02 13:41:09.623 18968 18968 F DEBUG   : Cause: seccomp prevented call to disallowed arm64 system call 434
10-02 13:41:09.623 18968 18968 F DEBUG   :     x0  00000000000049f6  x1  0000000000000000  x2  0000000000000000  x3  0000000000000000
10-02 13:41:09.623 18968 18968 F DEBUG   :     x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0000000000000004
10-02 13:41:09.623 18968 18968 F DEBUG   :     x8  00000000000001b2  x9  0000000000000004  x10 0000000000000000  x11 0000000000000000
10-02 13:41:09.624 18968 18968 F DEBUG   :     x12 0000000000000000  x13 0000000000000008  x14 0000000000000004  x15 0000000000000005
10-02 13:41:09.624 18968 18968 F DEBUG   :     x16 00000040000963a0  x17 0000004000096740  x18 00000072fcdae000  x19 0000007399b85c30
10-02 13:41:09.624 18968 18968 F DEBUG   :     x20 0000004000096920  x21 0000004000096db8  x22 000000739b006060  x23 000000739b005dd8
10-02 13:41:09.624 18968 18968 F DEBUG   :     x24 000000739b005d50  x25 000000739b005d50  x26 0000007399dace28  x27 0000000000000003
10-02 13:41:09.624 18968 18968 F DEBUG   :     x28 0000004000184a80  x29 00000040000965c8
10-02 13:41:09.624 18968 18968 F DEBUG   :     sp  00000040000965d0  lr  0000007399b9c36c  pc  0000007399b8b350
10-02 13:41:09.625 18968 18968 F DEBUG   :
10-02 13:41:09.625 18968 18968 F DEBUG   : backtrace:
10-02 13:41:09.625 18968 18968 F DEBUG   :       #00 pc 0000000000186350  /data/app/io.github.asutorufa.tailscaled-XbWesEvrvKzvFRRjhROVMA==/lib/arm64/libgojni.so

What stands out is: seccomp prevented call to disallowed arm64 system call 434 This is a Samsung Note 9 with Enforcing

Asutorufa commented 1 month ago

I have no idea about this error, I have Samsung tab s9 with oneui 6.1, it's no problem for me.

gbraad commented 1 month ago

On my Tab S6 it starts. The Note 9 is still on Android 10. I might spend some time to get more information and/or solution.

Asutorufa commented 1 month ago

It seems seccomp not allowed syscall pidfd_open.

https://www.chromium.org/chromium-os/developer-library/reference/linux-constants/syscalls/#aarch64_434

which is issue of golang, it already fixed at https://github.com/golang/go/commit/a3a05ed04cb53c53bdacded2d16f0f3e5facdbb0, we should build it with latest golang.

Asutorufa commented 1 month ago

The fixd maybe released with next go version(1.23.3), currect can try build with go dev branch.

https://github.com/golang/go/commits/release-branch.go1.23/

The issue introduced at https://github.com/golang/go/commit/750738b5d197b8b70403c7941fbe0dd20e00ebc9. Older go version(before go 1.23.0) seems no problem. see: https://github.com/tailscale/tailscale/issues/13452

Asutorufa commented 1 week ago

https://github.com/Asutorufa/tailscaled-socks5-android/commit/a416246b54ad6aac1d90672a0aa6f3182a6b5367