Skip to content
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

get_gpa_access_state: avoid returning dangling reference #163

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

syntactically
Copy link

Summary of the PR

Users of mshv-ioctls-0.2.x can experience heap corruption when using dirty page tracking, and need this patch to avoid this.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

Previously, VmFd::get_gpa_access_state returned a dangling
reference (in the form of a raw pointer) to a vector that was
allocated and freed during the function call.  This commit modifies it
to instead return the vector directly, since no other information is
required by its only consumer (VmFd::get_dirty_log).

Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
@liuw liuw merged commit 8dd7b14 into rust-vmm:v0.2.x Sep 2, 2024
5 of 6 checks passed
@liuw
Copy link
Member

liuw commented Sep 2, 2024

@NunoDasNeves I will leave it to you to tag 0.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants