-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[release/7.0] Ensure free buffer space when reading TLS messages #83574
Conversation
The initial size is not enough to cover later TLS frames
Tagging subscribers to this area: @dotnet/ncl, @vcsjones Issue DetailsBackport of #83480 to release/7.0 /cc @rzikm Customer ImpactTestingRiskIMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -684,10 +684,18 @@ private async ValueTask<int> EnsureFullTlsFrameAsync<TIOAdapter>(CancellationTok | |||
return frameSize; | |||
} | |||
|
|||
if (frameSize < int.MaxValue) | |||
if (frameSize != int.MaxValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it needed? Looks like semantically it is the same. Only MaxValue can be "not <".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, it was part of stylistic change to make it evident that int.MaxValue
is a special value ("unknown size"). I can remove it from the backport.
Impact on customers hitting real servers (see top post), worth servicing. |
I'm retargeting this PR to the new Repo maintainers will now be allowed to merge their own servicing PR as long as it meets the requirements:
The new process is described here: runtime/docs/project/library-servicing.md. The infra team will be actively monitoring servicing PRs to ensure all requirements are met and to help with any issues. Let me know if you have any questions. |
Test failures are known problems - tracked in #83901 |
@carlossanlop The |
Test failures are #83901 (known and closed already) |
Backport of #83480 to release/7.0
Fixes #83455.
/cc @rzikm
Customer Impact
7.0 Introduced regression where SslStream would fail to establish TLS connection (and, by extension, HTTPS) to some servers in very specific circumstances (depending on the sizing of TLS records exchanged during the handshake). One such server is
lh3.googleusercontent.com
.For affected servers it happens all the time - i.e. .NET is unable to establish connection to them.
Testing
Manual test against the affected server
lh3.googleusercontent.com
.CI test suite passes.
Risk
Low, we didn't change code path when the frame size is known. The code change affects only code path when the frame size is unknown, which happens only when the server sends TLS frames slightly shorter than 16K/8K/4K (see example of the google server above).