fix: correct gvisor replace directive to match module path#26822
Conversation
The replace directive targeted `gvisor.dev` but the actual module path declared in gvisor's go.mod is `gvisor.dev/gvisor`. 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. Fixes #20885
756ab93 to
47fb272
Compare
ValidationFully validated this fix by reproducing the bug on the unpatched gVisor version and confirming it's resolved with the fork. Reproducer toolAdded Run with: Scenario 1: Unpatched gVisor (v2.33.5 customer version)Built the reproducer against the raw upstream Result: Scenario 2: Patched gVisor (this PR)Built against the coder/gvisor fork ( Result: no panic. The fork's
Unit testsTwo tests validate both defense layers of the fork: Additional validation
Generated by Coder Agents on behalf of @denisra |
31cc6a7 to
f19c471
Compare
f19c471 to
9c36ec8
Compare
54a8d9e to
db37136
Compare
sreya
left a comment
There was a problem hiding this comment.
LGMT but I'd remove the scripts/ additions, I think a regression test is unnecessary here
db37136 to
47fb272
Compare
Summary
Fixes the gvisor
replacedirective ingo.modto target the correct module path.Supersedes #26750 (closed).
Problem
PR #23055 added a replace directive to use the coder/gvisor fork (which fixes an integer overflow causing
panic: length < 0crashes). However, the directive targeted the wrong module path:The actual module path declared in gvisor's
go.modisgvisor.dev/gvisor, notgvisor.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
Validation
Verified locally with
go list -m:Before (no-op replace):
After (correct replace):
The
=>confirms the fork is now applied.Fixes #20885
Investigation context
7a658db7b714) declaresmodule gvisor.dev/gvisorin its go.modgvisor.dev/gvisor@v0.0.0-20240509041132-65b30f7869dc(unpatched upstream), confirming the fork was not appliedpanic: length < 0ingvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).splitSegGenerated by Coder Agents on behalf of @denisra