Skip to content

Conversation

@ludfjig
Copy link
Contributor

@ludfjig ludfjig commented Jun 4, 2025

Currently, it's possible for the cancel_requested flag to be cleared without the vcpu being cancelled. This can lead to a call to kill() being lost. Consider the following thread interleaving:

  1. Vcpu finishes vcpu::run()
  2. Other thread calls kill() which sets cancel_requested to true
  3. Vcpu sets cancel_requested to false.
  4. Other thread sends signal, which doesn't do anything because vcpu thread is in userspace.
  5. Vcpu returns as normal

This PR fixes it by only clearing the flag when the vcpu is actually interrupted.

Signed-off-by: Ludvig Liljenberg <[email protected]>
@ludfjig ludfjig merged commit ae4c10a into hyperlight-dev:main Jun 4, 2025
45 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants