-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/net/route: ParseRIB still panics on macOS #71557
Comments
I was in the process of fixing other issues in the pkg with address parsing, can you please do a recover and produce byte array so I can add it to the tests cases, otherwise I will submit a fix this morning. |
Also length of 2 seems odd, since the only address that should have variable lengths are netmasks and IPv4 address typically are valid if the have a length of one of the following 0, 5, 6, 7, 8 Unix Networking Programming Volume 1
Which obviously means there is at least 2 bugs in the package right now. |
Obviously this is an ipv6 address we are working with. |
Previously, we enforced minimum length requirements for sockaddr, but the kernel can legitimately return shorter lengths. This change treats any sockaddr with length less than the address offset as an unspecified address (0.0.0.0 for IPv4 or :: for IPv6). Fixes golang/go#71557
With golang/net#231 |
Change https://go.dev/cl/646556 mentions this issue: |
Previously, we enforced minimum length requirements for sockaddr, but the kernel can legitimately return shorter lengths. This change treats any sockaddr with length less than the address offset as an unspecified address (0.0.0.0 for IPv4 or :: for IPv6). Fixes golang/go#71557
Previously, we enforced minimum length requirements for sockaddr, but the route command can legitimately parse shorter lengths. This change treats any sockaddr with length less than the address offset as an unspecified address (0.0.0.0 for IPv4 or :: for IPv6), as discern by monitoring the route command. To replicate the issue, prior to the fix, execute the following: First, ```console route -n monitor ``` Next, ```console sudo route -n add -inet6 -ifscope en11 -net :: \ -netmask :: fe80::2d0:4cff:fe10:15d2 ``` The route command that is actively monitor will print something such as, ```console RTM_ADD: Add Route: len 152, pid: 81198, seq 1, errno 0, ifscope 13, flags:<UP,GATEWAY,DONE,STATIC,IFSCOPE> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> :: fe80::2d0:4cff:fe10:15d2 :: ``` Prior to the fix, if you had parse the above message, PareRIB would have returned errInvalidAddr which is clearly false. Fixes golang/go#71557
I can't reproduce at will on my machine. This is from crash telemetry from our users. We'd need to release a new version of our code with more recording to get the byte arrays. |
Yeah no worries I was able to reproduce it and there is a PR to fix it |
Notably, this pulls in https://go.googlesource.com/net/+/2dab271ff1b7396498746703d88fefcddcc5cec7 for golang/go#71557. Updates #8043 Change-Id: I3637dbf27b90423dd4d54d147f12688b51f3ce36 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Notably, this pulls in https://go.googlesource.com/net/+/2dab271ff1b7396498746703d88fefcddcc5cec7 for golang/go#71557. Updates #8043 Change-Id: I3637dbf27b90423dd4d54d147f12688b51f3ce36 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Notably, this pulls in https://go.googlesource.com/net/+/2dab271ff1b7396498746703d88fefcddcc5cec7 for golang/go#71557. Updates #8043 Change-Id: I3637dbf27b90423dd4d54d147f12688b51f3ce36 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
go version go1.23.5 darwin/arm64
The #70528 fun continues... we now see panics in x/net/route ParseRIB even at v0.34.0:
/cc @raggi @hurricanehrndz
The text was updated successfully, but these errors were encountered: