fix: correct gvisor replace directive to match module path (#26822) - #27137
Merged
Conversation
## Summary Fixes the gvisor `replace` directive in `go.mod` to target the correct module path. ## Problem PR #23055 added a replace directive to use the coder/gvisor fork (which fixes an integer overflow causing `panic: length < 0` crashes). However, the directive targeted the wrong module path: ``` replace gvisor.dev => github.com/coder/gvisor v0.0.0-20260313164934-7a658db7b714 ``` The actual module path declared in gvisor's `go.mod` is `gvisor.dev/gvisor`, not `gvisor.dev`. Go module replace directives require an exact module path match, so the previous directive was a no-op and the patched fork was never used. ## Fix ```diff -replace gvisor.dev => github.com/coder/gvisor v0.0.0-20260313164934-7a658db7b714 +replace gvisor.dev/gvisor => github.com/coder/gvisor v0.0.0-20260313164934-7a658db7b714 ``` ## Validation Verified locally with `go list -m`: **Before (no-op replace):** ``` $ go list -m gvisor.dev/gvisor gvisor.dev/gvisor v0.0.0-20240509041132-65b30f7869dc ``` **After (correct replace):** ``` $ go list -m gvisor.dev/gvisor gvisor.dev/gvisor v0.0.0-20240509041132-65b30f7869dc => github.com/coder/gvisor v0.0.0-20260313164934-7a658db7b714 ``` The `=>` confirms the fork is now applied. Fixes #20885 --- <details> <summary>Investigation context</summary> - The coder/gvisor fork (commit `7a658db7b714`) declares `module gvisor.dev/gvisor` in its go.mod - Customer runtime stack traces show `gvisor.dev/gvisor@v0.0.0-20240509041132-65b30f7869dc` (unpatched upstream), confirming the fork was not applied - The crash is `panic: length < 0` in `gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).splitSeg` - Related Linear ticket: ENT-118 </details> --- *Generated by [Coder Agents](https://coder.com/agents) on behalf of @denisra* (cherry picked from commit f77d006)
mtojek
self-requested a review
July 13, 2026 07:07
mtojek
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #26822 (
f77d0065ed) ontorelease/2.35.The gvisor
replacedirective on this branch targetsgvisor.devinstead of the module pathgvisor.dev/gvisor. Go matches replace directives by exact module path, so the directive is a silent no-op: v2.34.5, v2.35.0, and v2.35.1 all built against upstream gvisorv0.0.0-20240509041132without the integer-overflow crash fix from coder/gvisor (#20885).go.sumon this branch has nocoder/gvisorentries, confirming the fork was not in the build.Changes
gvisor.dev/gvisor => github.com/coder/gvisor v0.0.0-20260313164934-7a658db7b714(go.mod + go.sum).Verification
go list -m gvisor.dev/gvisornow resolves togithub.com/coder/gvisor v0.0.0-20260313164934-7a658db7b714.go mod tidyis a no-op;go build ./agent/... ./tailnet/...passes.release/2.34already carry this fix;release/2.35was the only maintained branch missing it.