Repository navigation
Fix potential use-after-free in com_apartment_variable - #679
Merged
Merged
Conversation
Duncan Horn (dunhor)
requested review from
Chris Guzak (ChrisGuzak) and
Jon Wiswall (jonwis)
November 17, 2026 20:40
This reverts commit c6156cd.
Jon Wiswall (jonwis)
approved these changes
Nov 18, 2026
|
Hi Duncan Horn (@dunhor) and team, Thank you for addressing this and getting the fix merged via PR #679! While MSRC classified and closed this as a non-security reliability issue (which is completely understandable given the trust boundary), I'm glad the core lifetime bug in com_apartment_variable.h has been resolved. Since I originally reported and diagnosed this issue (Issue #678), would it be possible to kindly include a brief acknowledgment or mention of my contribution in the upcoming release notes or changelog? Thanks again for maintaining WIL and for the smooth collaboration! |
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.
Fixes #678
This is your standard case of dropping a lock while holding a resource that can disappear. There's no technical reason why we need to hold the resource - it appears to just be an attempt at an optimization - so the fix is to re-acquire the resource after obtaining the lock again.
The issue mentions reentrancy as a possible repro of the issue, however that's not a very realistic scenario and would break a potentially obvious contract. A much more reasonable repro is another thread in the same apartment racing with the
get_or_createcall.