Ensure that socket timeouts are set only during the token validation#26066
Merged
daxian-dbw merged 3 commits intomasterfrom Sep 22, 2025
Merged
Ensure that socket timeouts are set only during the token validation#26066daxian-dbw merged 3 commits intomasterfrom
daxian-dbw merged 3 commits intomasterfrom
Conversation
TravisEz13
commented
Sep 18, 2025
| @@ -454,6 +454,9 @@ internal static void ValidateToken(Socket socket, string token, CancellationToke | |||
|
|
|||
| // Acknowledge the token is valid with "PASS". | |||
| socket.Send("PASS"u8); | |||
Member
Author
There was a problem hiding this comment.
Comment on behalf colleague, Can the timeout be triggered accidentally here?
Member
Author
|
/azp run PowerShell-CI-linux-packaging, PowerShell-Windows-Packaging-CI |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
…s and adjust socket timeouts accordingly
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
📣 Hey @@TravisEz13, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
pwshBot
pushed a commit
to pwshBot/PowerShell
that referenced
this pull request
Sep 22, 2025
…owerShell#26066) The main goal is to ensure that socket timeouts are set only during the token validation phase and are properly reset afterward, improving reliability and preventing unintended blocking or premature timeouts in subsequent operations.
9 tasks
pwshBot
pushed a commit
to pwshBot/PowerShell
that referenced
this pull request
Sep 22, 2025
…owerShell#26066) The main goal is to ensure that socket timeouts are set only during the token validation phase and are properly reset afterward, improving reliability and preventing unintended blocking or premature timeouts in subsequent operations.
9 tasks
5 tasks
SIRMARGIN
pushed a commit
to SIRMARGIN/PowerShell
that referenced
this pull request
Dec 12, 2025
…owerShell#26066) The main goal is to ensure that socket timeouts are set only during the token validation phase and are properly reset afterward, improving reliability and preventing unintended blocking or premature timeouts in subsequent operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
This pull request refactors how socket timeouts are managed during token validation in
RemoteSessionHyperVSocket.cs. The main goal is to ensure that socket timeouts are set only during the token validation phase and are properly reset afterward, improving reliability and preventing unintended blocking or premature timeouts in subsequent operations.Socket Timeout Management Improvements:
RemoteSessionHyperVSocketServerconstructor to theValidateTokenmethod, ensuring timeouts are applied only during token validation. [1] [2]PR Context
This theoretical regression in #26057
This is theoretical because this code is not currently exercised.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header