-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/tls: segfault when calling tlsrsakex.IncNonDefault()
#65991
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
Comments
cc @golang/security |
The good news is that the IncNonDefault call is gated by Definitely an oversight in Go+BoringCrypto mode. |
@gopherbot please open a Go 1.22 backport issue. This is a severe regression in Go+BoringCrypto mode. |
Backport issue(s) opened: #65994 (for 1.22). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
@FiloSottile Not sure who to ping on this, would it be enough to just solve the segfault? |
Change https://go.dev/cl/582315 mentions this issue: |
Change https://go.dev/cl/586755 mentions this issue: |
IncNonDefault panics if Value was not called. That's too much DoS risk in crypto/tls, when the call to Value is distant from the call to IncNonDefault (see #65991). Value is cheap, though, so we can just call it before each isolated IncNonDefault. Change-Id: I6dbed345381e60e029b0a5ef2232e846aa089736 Reviewed-on: https://go-review.googlesource.com/c/go/+/586755 Reviewed-by: Roland Shoemaker <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
FYI for anyone scrolling to the bottom of this the cherry-pick/backport of this patch into a 1.22 release is being tracked in #65994 |
Change https://go.dev/cl/593395 mentions this issue: |
…t with FIPS We haven't called tlsrsakex.Value() yet at this point if we're using FIPS, like if CipherSuites != nil. This adds needFIPS as a gate next to CipherSuites != nil. FIPS specifies suites that would be skipped if tlsarsakex were set. For #65991. Fixes #65994. Change-Id: I8070d8f43f27c04067490af8cc7ec5e787f2b9bd Reviewed-on: https://go-review.googlesource.com/c/go/+/582315 Reviewed-by: Filippo Valsorda <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Bypass: Filippo Valsorda <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> (cherry picked from commit 78e50d0) Reviewed-on: https://go-review.googlesource.com/c/go/+/593395 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
Go version
go version go1.22.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Tried to connect to a postgres DB over TLS using jackc/pgx (see stack trace).
What did you see happen?
A panic when
crypto/tls
callsinternal/godebug.(*Setting).IncNonDefault
:What did you expect to see?
Expected no segfault/panic. Looking at
crypto/tls
, it's my suspicion that, due to having goboring enabled and thus needing FIPS,tlsrsakex.Value()
has not been called whentlsrsakex.IncNonDefault()
is called. This could probably be triggered by having non default.CipherSuites
set as well. Perhaps the underlying issue is that RSA ciphers aren't filtered out offipsCipherSuites()
in the first place, which is what allows the branch withIncNonDefault()
to even be taken.The text was updated successfully, but these errors were encountered: