-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix key exchange hang for outofproc transports #11380
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
Fix key exchange hang for outofproc transports #11380
Conversation
…essing threads for session and command protocol messages.
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
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.
One NIT
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
|
@PaulHigin merge upstream/master tp pick up fix for the nulconditional tests |
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
8000
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
|
This will probably fix Azure/azure-functions-powershell-worker#259 |
|
Will this issue be considered for GA? Otherwise, the Azure Function issue won't really be resolved until 7.1, which maybe a year later. |
|
I would love for it to make it into GA. |
|
Hello, just trying to understand, i see GA-approved for this PR, does it mean it will also solve for the Azure Functions issue ? (Azure/azure-functions-powershell-worker#259) |
|
Yes, this will address that issue, as soon as the Azure Functions team adopts PowerShell 7 in their runtime. |
PR Summary
This PR fixes the remoting key exchange hang in OutOfProc transport connections, when transferring SecureString objects.
Fixes issue: #259
PR Context
When a SecureString object is transferred over the remoting layer, a key exchange algorithm is lazily run so that the contents of the SecureString can be encrypted. This is not strictly necessary since both WinRM and SSH remoting channels already encrypt data on the wire by default. But the key exchange must remain for compatibility reasons.
The hang occurs when the target sends an encrypted SecureString object to the client for the first time. The client begins a key exchange handshake with the target so that it can handle the object. This works fine for WinRM based remote connections because the client processes session and command protocol messages on different threads. But the OutOfProc based transport implementations process client protocol messages on a single thread, and the lazily initiated key exchange results in a deadlock.
The fix is to update the OutOfProc transport manager base class to detect and process command and session client protocol messages on separate threads.
This is not a low risk change since it affects four remote implementations that are based on the OutOfProc transport: background jobs, PowerShellDirect, named pipes, SSH.
Repro Steps:
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.