openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.91k stars 3.42k forks source link

softethervpn5: vpnclient page faults after 21.x -> 22.x upgrade #20807

Open tew42 opened 1 year ago

tew42 commented 1 year ago

Maintainer: @Andy2244 Environment: ath79 - TP-Link Archer A7 - OpenWRT 22.03.3

Description: Running a SoftetherVPN client on my router worked well for me on 21.x (most recently 21.02.4). I upgraded to 22.03.3 today, and encountered a loop of VPN start -> access violation -> reconnect -> access violation, as documented below.

I tried both with importing the old config, and with setting up a new configuration from scratch; same behavior.

Happy to provide additional info, just not quite sure where/how... Thanks!

Log excerpt:

15:03:05 2023 kern.info kernel: [  xxx] do_page_fault(): sending SIGSEGV to vpnclient for invalid write access to 00000000
15:03:05 2023 kern.info kernel: [  xxx] epc = 77dbf96c in libc.so[77d8e000+a9000]
15:03:05 2023 kern.info kernel: [  xxx] ra  = 77dbf908 in libc.so[77d8e000+a9000]
15:03:05 2023 daemon.notice netifd: Network device 'vpn_xxx' link is down
15:03:05 2023 daemon.notice netifd: Interface 'VPN' has link connectivity loss
15:03:05 2023 daemon.notice netifd: VPN (4064): udhcpc: SIOCGIFINDEX: No such device
15:03:05 2023 daemon.notice netifd: VPN (4064): udhcpc: received SIGTERM
15:03:05 2023 daemon.notice netifd: VPN (4064): udhcpc: unicasting a release of 192.168.xxx.xxx to 192.168.xxx.xxx
15:03:05 2023 daemon.notice netifd: VPN (4064): udhcpc: sending release
15:03:05 2023 daemon.notice netifd: VPN (4064): udhcpc: can't bind to interface vpn_xxx: No such device
15:03:05 2023 daemon.notice netifd: VPN (4064): udhcpc: bindtodevice: No such device
15:03:05 2023 daemon.notice netifd: VPN (4064): udhcpc: entering released state
15:03:05 2023 daemon.notice netifd: VPN (4064): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "VPN" } (Permission denied)
15:03:05 2023 daemon.notice netifd: Interface 'VPN' is now down
15:03:05 2023 daemon.notice netifd: Interface 'VPN' is disabled
15:03:11 2023 daemon.notice netifd: Interface 'VPN' is enabled
15:03:11 2023 daemon.notice netifd: Network device 'vpn_xxx' link is up
15:03:11 2023 daemon.notice netifd: Interface 'VPN' has link connectivity
15:03:11 2023 daemon.notice netifd: Interface 'VPN' is setting up now
15:03:11 2023 daemon.notice netifd: VPN (4822): udhcpc: started, v1.35.0
15:03:11 2023 daemon.notice netifd: VPN (4822): udhcpc: broadcasting discover
15:03:14 2023 daemon.notice netifd: VPN (4822): udhcpc: broadcasting discover
15:03:14 2023 daemon.notice netifd: VPN (4822): udhcpc: broadcasting select for 192.168.xxx.xxx, server 192.168.xxx.xxx
15:03:15 2023 daemon.notice netifd: VPN (4822): udhcpc: lease of 192.168.xxx.xxx obtained from 192.168.xxx.xxx, lease time 43200
15:03:15 2023 daemon.notice netifd: Interface 'VPN' is now up
15:03:17 2023 user.notice firewall: Reloading firewall due to ifup of VPN (vpn_xxx)
15:04:09 2023 kern.info kernel: [  xxx] do_page_fault(): sending SIGSEGV to vpnclient for invalid write access to 00000000
15:04:09 2023 kern.info kernel: [  xxx] epc = 77e4996c in libc.so[77e18000+a9000]
15:04:09 2023 kern.info kernel: [  xxx] ra  = 77e49908 in libc.so[77e18000+a9000]

etc.

V-ctor commented 1 year ago

Is there any progress? I think I have the same issue, client starts working then fails, I restart it, it works for ~1 min then fails again. May be there are some work arounds? It's remote device and it's impossible to downgrade OS, but may be some old version, paths, recompilation etc?

dmesg full of:

[733800.506253] do_page_fault(): sending SIGSEGV to vpnclient for invalid write access to 0000ffff [733800.515262] epc = 77e788e8 in libc.so[77df8000+aa000] [733800.520557] ra = 778cdc84 in libcrypto.so.1.1[777dc000+1ac000] [733968.144210] do_page_fault(): sending SIGSEGV to vpnclient for invalid write access to 00000000 [733968.153243] epc = 77e3a02c in libc.so[77e08000+aa000] [733968.158527] ra = 77e39fc8 in libc.so[77e08000+aa000] [734159.839695] do_page_fault(): sending SIGSEGV to vpnclient for invalid read access from 00000008 [734159.848830] epc = 77d79a5c in libc.so[77d48000+aa000] [734159.854116] ra = 77d79fa8 in libc.so[77d48000+aa000] [734219.756609] do_page_fault(): sending SIGSEGV to vpnclient for invalid read access from 00000008 [734219.765720] epc = 77e51a5c in libc.so[77e20000+aa000] [734219.771059] ra = 77e51fa8 in libc.so[77e20000+aa000]

softethervpn5-client - 5.02.5180-2 Linux OpenWrt 5.10.176 #0 Sun Apr 9 12:27:46 2023 mips GNU/Linux OpenWrt 22.03.4, r20123-38ccc47687

tew42 commented 1 year ago

See #20850 for my "fix" and why it can't easily be implemented in 22.03. If you're sufficiently comfortable messing around the build environment you should be able to custom-compile the updated package for your device like I did. For a proper implementation, lacking further external input, I am currently waiting for 23.05 (where the compile issues are fixed) to stabilize a bit more before I re-visit the pull request.

V-ctor commented 1 year ago

@tew42 Well I can't say that compilation is really complicated for me but in the same time I'm not familiar with OpenWRT environment. I'd prefer to find another way. I found #19963 that old version 4.38 works good as a server. May be the client one works good as well? Do you know? Btw what is the difference between versions 4.38 and 5? If 4.38 does not help and the only solution is custom compilation then could you point me more details/instructions? I've just build custom OpenWRT firmware only once from packages not sources. My target platform is MIPS32/BCM63XX. I will appreciate any details/steps. Thank you

V-ctor commented 1 year ago

I tried softethervpn-client 4.38 and it works good. Now I'm happy!