Skip to content

dont try to zero-out mapping if VirtualAlloc fails #116794

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
merged 1 commit into from
Jun 18, 2025

Conversation

mangod9
Copy link
Member

@mangod9 mangod9 commented Jun 18, 2025

There has been one case where this leads to an AV / deadlock.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a potential access violation/deadlock by preventing the release mapping if VirtualAlloc fails.

  • Adds a NULL check after calling VirtualAlloc to ensure that mapping is not released when allocation fails.
  • Prevents subsequent operations on an invalid pointer, avoiding a crash.

@janvorli
Copy link
Member

The PR title is a bit misleading - it should rather be "don't try to zero out mapping if VirtualAlloc fails". That's what was causing the problem.

@mangod9 mangod9 changed the title dont try to release mapping if VirtualAlloc fails dont try to zero-out mapping if VirtualAlloc fails Jun 18, 2025
@mangod9
Copy link
Member Author

mangod9 commented Jun 18, 2025

The PR title is a bit misleading - it should rather be "don't try to zero out mapping if VirtualAlloc fails". That's what was causing the problem.

sure, changed the title. Thx.

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@mangod9 mangod9 merged commit f4bc468 into dotnet:main Jun 18, 2025
97 checks passed
@mangod9 mangod9 deleted the fix_reservepage_av branch June 18, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants