GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — icmp: workaround for gvisor's fake ICMP echo by Lanius-collaris · Pull Request #142 · celzero/firestack Conversation
|
|
Thanks. I wonder if this forceful default handling of ICMP is a bug on gvisor upstream despite having set a ICMP handler? It was working as I'd expect it to in previous (believe a year or so ago) gvisor version. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces a workaround for gvisor's fake ICMP echo by modifying the ICMP packet types and recalculating checksums for both ICMPv6 and ICMPv4 before processing.
intra/netstack/icmp.go:36
icmp6Hdr.SetType(200)
intra/netstack/icmp.go:56
icmp4Hdr.SetType(253)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
🤔Will current handler work if these lines are deleted? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I have a theory that these lines were written for inbound ICMP echo requests (packet sockets can receive them). @kevinGC |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, what's the specific question? I'm missing some context and not sure what 'fake' means in the title here. I don't remember any recent changes to ICMP handling. If you've set a custom handler for ICMP packets and the stack is still doing its own ICMP handling, I think that's because ICMP handling is tightly coupled to the ipv4 and ipv6 packages. Nobody has tried to split them AFAIK, so there's no easy way to turn off just ICMP. Packet sockets should get ICMP messages regardless of the code in the ipv4 and ipv6 packages; it happens earlier in packaet processing (around nic.go:DeliverLinkPacket). BTW @nybidari is the gVisor networking lead these days. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Netstack replies to ICMP messages on its own and does not wait on the Handler set via I should note that Netstack we use is setup with Spoofing and is Promiscuous (ref), in addition to being the default gateway (
This happens even today. The Handler does get those packets, but Netstack replies to those packets before the Handler has had the chance. Like @Lanius-collaris points out, ICMP is handled internally (here) before being delivered to the Handler (here?)? For us, it is enough if ICMP requests ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
"packet sockets" here mean sockets created with
I have tried and succeeded. 😆 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
bf17d71 to
04fe473
Compare
| rules[index].Filter.Protocol = header.ICMPv6ProtocolNumber | ||
| rules[index].Filter.CheckProtocol = true | ||
| rules[index].Target = target | ||
| ipt.ReplaceTable(stack.MangleID, table, true) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I tried bumping gvisor for my gvisor-playground, found that new gvisor requires ForceReplaceTable() to work. All rules in iptables become useless if shouldSkipOrPopulateTables() returns true……
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Are you saying, for the current changes to work, firestack would have to be pinned to its current gvisor@go version v0.0.0-20250816201027-ba3b9ca85f20?
Line 27 in 96bf8e8
| gvisor.dev/gvisor v0.0.0-20250816201027-ba3b9ca85f20 |
(I never really got the hang of the gvisor/netstack internals at all...)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I tried bumping gvisor for my gvisor-playground, found that new gvisor requires ForceReplaceTable() to work. All rules in iptables become useless if shouldSkipOrPopulateTables() returns true……
Are you saying, for the current changes to work, firestack would have to be pinned to its current gvisor@go version
v0.0.0-20250816201027-ba3b9ca85f20?
I mean that shouldSkipOrPopulateTables() return true ( https://github.com/google/gvisor/blob/fd370915f22e/pkg/tcpip/stack/iptables.go#L315 in some cases gvisor thinks modified iptables are not modified ) so 2cc55a2 doesn't work, but IPTables.ForceReplaceTable() solves this problem, IPTables.ReplaceTable() in gvisor v0.0.0-20231023213702-2691a8f9b1cf ( used by my gvisor-playground ) always works.
The comment about gvisor v0.0.0-20250816201027-ba3b9ca85f20 means that firestack's handler is not called after stack.SetTransportProtocolHandler(icmp.ProtocolNumber6, …)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lify icmpForwarder.reply4() and icmpForwarder.reply6()
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Can we create a bool |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Even if gvisor changes the behavior ( in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Gotcha.
Recompiling firestack is no big deal? Each commit batch has a compiled artifact pushed to GitHub Packages and Maven Central... and we've managed to upgrade the gvisor@go module from upstream without much fanfare (at least until now). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I means rethink app can't call |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.