Skip to content

vmbus_server: always notify that the connection is modified when disconnecting #1817

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

Merged

Conversation

SvenGroot
Copy link
Member

This change fixes an issue where, if all channels are already reset when a disconnect happens, the server would not invoke
Notifier::modify_connection. This means that the state such as the interrupt page and monitor pages is not reset, and in the case of OpenHCL the relay is not notified of the disconnect (which can leave host state intact, including monitor pages if MNF is handled by the host).

This caused an issue where Linux would occasionally crash during resume from hibernate. When resuming, Linux makes two connections, first to read the memory image, and then to resume normal operations, both using MNF. When the first connection unloads, the overlay pages for the monitor pages were not removed until the reconnect, leading to memory corruption when Linux proceeds to use these pages as normal memory.

This change also adds some tests ensuring the notifier is invoked for an unload with open channels, without open channels, and a forced disconnect when a new InitiateContact message is received.

Cherry-picked from #1809

…onnecting (microsoft#1809)

This change fixes an issue where, if all channels are already reset when
a disconnect happens, the server would not invoke
`Notifier::modify_connection`. This means that the state such as the
interrupt page and monitor pages is not reset, and in the case of
OpenHCL the relay is not notified of the disconnect (which can leave
host state intact, including monitor pages if MNF is handled by the
host).

This caused an issue where Linux would occasionally crash during resume
from hibernate. When resuming, Linux makes two connections, first to
read the memory image, and then to resume normal operations, both using
MNF. When the first connection unloads, the overlay pages for the
monitor pages were not removed until the reconnect, leading to memory
corruption when Linux proceeds to use these pages as normal memory.

This change also adds some tests ensuring the notifier is invoked for an
unload with open channels, without open channels, and a forced
disconnect when a new InitiateContact message is received.

---------

Co-authored-by: Copilot <[email protected]>
@SvenGroot SvenGroot requested review from a team as code owners August 6, 2025 17:05
@github-actions github-actions bot added the release_2505 Targets the release/2505 branch. label Aug 6, 2025
Copy link

github-actions bot commented Aug 6, 2025

@benhillis benhillis merged commit 4bdf5bb into microsoft:release/2505 Aug 6, 2025
44 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_2505 Targets the release/2505 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants