Add advisory for use after free in pared <=0.3.0#2253
Merged
djc merged 1 commit intorustsec:mainfrom Mar 22, 2025
Merged
Conversation
kornelski
approved these changes
Mar 16, 2025
riking
approved these changes
Mar 21, 2025
Member
|
LGTM, thanks! |
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.
Use after free in
ParcandPrcdue to missing lifetime constraintsAffected versions of this crate didn't provide sufficient lifetime constraints to conversion
functions from
alloc::sync::Arcandalloc::rc::Rc, which made it possible to createprojections of these reference counted pointers. Unlike the original reference counted pointers,
these projections could outlive original data's lifetimes.
This projected pointer could cause the original
Arc's orRc'sDrop::dropto get called ata point where the original data was no longer valid, leading to a potential use after free.
The affected functions were
pared::prc::Prc::from_rcpared::prc::Prc::projectpared::prc::Prc::try_from_rcpared::sync::Parc::from_arcpared::sync::Parc::projectpared::sync::Parc::try_from_arcThis flaw was fixed in 108f540ea8acb6073751a1aa386085c1cdc4fd1e
by requiring that the type stored in the
Arcs andRcs passed to these functions containT: 'static.