[PR #3213] fix(awg-windows): build tunnel.dll with go 1.26.8 to fix socket I/O #3132

Open
opened 2026-10-15 04:07:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3213
Author: @leek231
Created: 9/24/2026
Status: 🔄 Open

Base: dev ← Head: fix/awg-windows-go-socket-bugs


📝 Commits (1)

  • ef05dab fix(awg-windows): build tunnel.dll with go 1.26.8 to fix socket I/O

📊 Changes

3 files changed (+30 additions, -2 deletions)

View changed files

📝 cmake/recipes_bootstrap.cmake (+3 -0)
📝 recipes/awg-windows/conanfile.py (+1 -1)
📝 recipes/go/conandata.yml (+26 -1)

📄 Description

fix(awg-windows): build tunnel.dll with go 1.26.8 to fix socket I/O

Fixes #3048

Problem

Go 1.26.0, used for all Go components since 5.0.x, has two regressions in Windows socket I/O:

  • golang/go#77885 — a non-nil empty cmsg buffer is mishandled in WSARecvMsg/WSASendMsg.
  • golang/go#78041 — the WSARecvFrom from-length (rsan) is kept on the stack during overlapped I/O, which corrupts the stack.

Both are fixed in Go 1.26.2 (release-branch commits 99df9bdb2a, 1a44be4cec).

In tunnel.dll, amneziawg-go first tries Registered I/O. If RIO is unavailable, it falls back to StdNetBind. That fallback path hits the bug, so every receive/send fails:

Registered I/O is unavailable: ...
Failed to receive v4 packet: read udp4 0.0.0.0:xxxxx: wsarecvmsg: The system detected an invalid pointer address ...

RIO is typically unavailable when a socket-level filter or LSP is installed, e.g. AdGuard SockFilter (see the analysis in #3048), Proxifier, or some AV/endpoint agents. This explains why only some users are affected, and why 4.8.21.0 (built with an older Go) works on the same machines.

Change

  • recipes/go/conandata.yml: add go 1.26.8 (checksums from https://go.dev/dl/?mode=json).
  • cmake/recipes_bootstrap.cmake: export go 1.26.8.
  • recipes/awg-windows: tool_requires("go/1.26.8").

Other recipes intentionally stay on 1.26.0 to keep this change minimal and not conflict with #3201, whose runtime patches for awg-go are generated against 1.26.0. The other Windows Go components (tun2socks, xray) can be moved to 1.26.8 in a follow-up.

Testing

  • Built tunnel.dll from amneziawg-windows v3.1.20260814 with the flags from recipes/awg-windows on go1.26.8.
    go version -m shows the same dependency set as 5.0.3.0.
  • Replaced tunnel.dll in an installed AmneziaVPN 5.0.3.0 on an affected PC. On that PC RIO fails with WSAEOPNOTSUPP (10045) and 5.0.3.0 fails with wsarecvmsg/wsasendmsg: invalid pointer.
    With the rebuilt DLL the tunnel connects and works. RIO is still unavailable there, so traffic goes through the fixed fallback path.
  • The full conan build was not run locally for all platforms.

Possibly related: #3146 (random 0xc0000005 in sync.Pool in tun2socks on Windows, built with go 1.26.0). This could be the #78041 stack corruption, but that is not confirmed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/3213 **Author:** [@leek231](https://github.com/leek231) **Created:** 9/24/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/awg-windows-go-socket-bugs` --- ### 📝 Commits (1) - [`ef05dab`](https://github.com/amnezia-vpn/amnezia-client/commit/ef05dab6694875f69240ca3cd0c147a83338e8a6) fix(awg-windows): build tunnel.dll with go 1.26.8 to fix socket I/O ### 📊 Changes **3 files changed** (+30 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `cmake/recipes_bootstrap.cmake` (+3 -0) 📝 `recipes/awg-windows/conanfile.py` (+1 -1) 📝 `recipes/go/conandata.yml` (+26 -1) </details> ### 📄 Description ## fix(awg-windows): build tunnel.dll with go 1.26.8 to fix socket I/O Fixes #3048 ### Problem Go 1.26.0, used for all Go components since 5.0.x, has two regressions in Windows socket I/O: - **golang/go#77885** — a non-nil empty cmsg buffer is mishandled in `WSARecvMsg`/`WSASendMsg`. - **golang/go#78041** — the `WSARecvFrom` from-length (`rsan`) is kept on the stack during overlapped I/O, which corrupts the stack. Both are fixed in Go 1.26.2 (release-branch commits `99df9bdb2a`, `1a44be4cec`). In `tunnel.dll`, amneziawg-go first tries Registered I/O. If RIO is unavailable, it falls back to `StdNetBind`. That fallback path hits the bug, so every receive/send fails: ``` Registered I/O is unavailable: ... Failed to receive v4 packet: read udp4 0.0.0.0:xxxxx: wsarecvmsg: The system detected an invalid pointer address ... ``` RIO is typically unavailable when a socket-level filter or LSP is installed, e.g. AdGuard SockFilter (see the analysis in #3048), Proxifier, or some AV/endpoint agents. This explains why only some users are affected, and why 4.8.21.0 (built with an older Go) works on the same machines. ### Change - `recipes/go/conandata.yml`: add go 1.26.8 (checksums from https://go.dev/dl/?mode=json). - `cmake/recipes_bootstrap.cmake`: export go 1.26.8. - `recipes/awg-windows`: `tool_requires("go/1.26.8")`. Other recipes intentionally stay on 1.26.0 to keep this change minimal and not conflict with #3201, whose runtime patches for `awg-go` are generated against 1.26.0. The other Windows Go components (tun2socks, xray) can be moved to 1.26.8 in a follow-up. ### Testing - Built `tunnel.dll` from amneziawg-windows v3.1.20260814 with the flags from `recipes/awg-windows` on go1.26.8. `go version -m` shows the same dependency set as 5.0.3.0. - Replaced `tunnel.dll` in an installed AmneziaVPN 5.0.3.0 on an affected PC. On that PC RIO fails with WSAEOPNOTSUPP (10045) and 5.0.3.0 fails with `wsarecvmsg/wsasendmsg: invalid pointer`. With the rebuilt DLL the tunnel connects and works. RIO is still unavailable there, so traffic goes through the fixed fallback path. - The full conan build was not run locally for all platforms. Possibly related: #3146 (random `0xc0000005` in `sync.Pool` in tun2socks on Windows, built with go 1.26.0). This could be the #78041 stack corruption, but that is not confirmed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3132
No description provided.