Add advisory for owned-alloc: panic-safety double-free in OwnedAlloc::drop_in_place - #3205
Open
tooson9010-spec wants to merge 1 commit into
Open
Add advisory for owned-alloc: panic-safety double-free in OwnedAlloc::drop_in_place#3205tooson9010-spec wants to merge 1 commit into
tooson9010-spec wants to merge 1 commit into
Conversation
4 tasks
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.
Affected crate(s)
owned-alloc(736,101 recent downloads per crates.io)Links to upstream issue(s) or PR(s)
Reported in bzim/owned-alloc#1 (2026-09-08). Same maintainer and account as
lockfree, where a public issue and a private email have both gone unanswered; no release since 2018.Severity
Panic-safety unsoundness in
OwnedAlloc::drop_in_place: the contained value is destroyed by hand, and themem::forget(self)that commits the ownership transfer lives insideinto_rawand so runs only afterwards. A panickingT::dropskips the commit, so the still-liveOwnedAllocunwinds and its destructor drops the sameTa second time before deallocating — a double free (CWE-415). The destructor also reads the destroyed value throughLayout::for_valueon the way (CWE-416). Confirmed under AddressSanitizer (attempting double-free).MaybeUninitAlloc::drop_in_placedelegates to the same function, so both public entry points are affected. Storing a value whoseDropcan panic and calling either is enough; nounsafeon the caller's side.Checklist
RUSTSEC-0000-0000as the IDdatefield is set to the public disclosure date