Fix RingBuffer::extend_from_within_unchecked unsoundness#76
Merged
KillingSpark merged 3 commits intoKillingSpark:masterfrom Nov 28, 2024
Merged
Fix RingBuffer::extend_from_within_unchecked unsoundness#76KillingSpark merged 3 commits intoKillingSpark:masterfrom
RingBuffer::extend_from_within_unchecked unsoundness#76KillingSpark merged 3 commits intoKillingSpark:masterfrom
Conversation
This was referenced Nov 27, 2024
StarStarJ
reviewed
Nov 27, 2024
StarStarJ
left a comment
There was a problem hiding this comment.
Works for my workflow with this patch.
I don't know the code of this crate, so I cannot really help with a proper review.
But thanks for taking care :D
paolobarbolini
commented
Nov 27, 2024
…d_from_within_unchecked
3614c90 to
4d30b3c
Compare
Owner
|
Thanks so much for fixing this! The text comments do add a lot of clarification. I find the diagrams a bit hard to read especially when they get to four lines of ^ markers. Maybe something like this would be better? |
Contributor
Author
|
What if we had something like this? To me it looks lighter on the eye. |
Owner
|
Yes! I think that's perfect |
4d30b3c to
d2521ec
Compare
d2521ec to
6d5573b
Compare
Contributor
Author
|
I think this is ready. I've tried adding Address Sanitizer and Memory Sanitizer to CI but they fail at linking: |
Owner
|
Thanks again for the quick action! |
KillingSpark
pushed a commit
that referenced
this pull request
Nov 28, 2024
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.
This fixes the unsoundness reported in #75 by correcting the
srclength math. Also adds safety and general comments, making it much easier to understand the logic.The first commit fixes the vulnerability while the other commits cleanup the implementation and add two unrelated debug assertions.
Fixes #75