Fix key exchange hang for outofproc transports#11380
Merged
anmenaga merged 6 commits intoPowerShell:masterfrom Dec 18, 2019
PaulHigin:fix-outofproc-transport-key-hang
Merged
Fix key exchange hang for outofproc transports#11380anmenaga merged 6 commits intoPowerShell:masterfrom PaulHigin:fix-outofproc-transport-key-hang
anmenaga merged 6 commits intoPowerShell:masterfrom
PaulHigin:fix-outofproc-transport-key-hang
Conversation
…essing threads for session and command protocol messages.
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
SteveL-MSFT
approved these changes
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Outdated
Show resolved
Hide resolved
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
Member
|
@PaulHigin merge upstream/master tp pick up fix for the nulconditional tests |
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
PoshChan
reviewed
Dec 17, 2019
src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs
Show resolved
Hide resolved
Member
|
This will probably fix Azure/azure-functions-powershell-worker#259 |
Member
|
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. |
Member
|
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) |
Member
|
Yes, this will address that issue, as soon as the Azure Functions team adopts PowerShell 7 in their runtime. |
22 tasks
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 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.