fix(deps): update rust crate linked_list_allocator to 0.10.0 [security] #70
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 PR contains the following updates:
0.9.0
->0.10.0
GitHub Vulnerability Alerts
CVE-2022-36086
Impact
What kind of vulnerability is it? Who is impacted?
This vulnerability impacts all the initialization functions on the
Heap
andLockedHeap
types, includingHeap::new
,Heap::init
,Heap::init_from_slice
, andLockedHeap::new
. It also affects multiple uses of theHeap::extend
method.Initialization Functions
The heap initialization methods were missing a minimum size check for the given heap size argument. This could lead to out-of-bound writes when a heap was initialized with a size smaller than
3 * size_of::<usize>
because of metadata write operations.Heap::extend
This vulnerability impacts three specific uses of the
Heap::extend
method:Heap::extend
with a size smaller than twousize
s (e.g., 16 onx86_64
), the size was erroneously rounded up to the minimum size, which could result in an out-of-bounds write.Heap::extend
on an empty heap tried to construct a heap starting at address 0, which is also an out-of-bounds write.Heap::new
(or a similar constructor) with a heap size that is smaller than twousize
s. This was treated as an empty heap as well.Heap::extend
on a heap whose size is not a multiple of the size of twousize
s resulted in unaligned writes. It also left the heap in an unexpected state, which might lead to subsequent issues. We did not find a way to exploit this undefined behavior yet (apart from DoS on platforms that fault on unaligned writes).Patches
Has the problem been patched? What versions should users upgrade to?
We published a patch in version
0.10.2
and recommend all users to upgrade to it. This patch release includes the following changes:2 * size_of::<usize>
and3 * size_of::<usize>
.extend
method now panics when trying to extend an unitialized heap.size_of::<usize>() * 2
are now buffered internally and not added to the list directly. The buffered region will be merged with futureextend
calls.size()
method now returns the usable size of the heap, which might be slightly smaller than thetop() - bottom()
difference because of alignment constraints.Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
To avoid this issue, ensure that the heap is only initialized with a size larger than
3 * size_of::<usize>
and that theHeap::extend
method is only called with sizes larger than2 * size_of::<usize>()
. Also, ensure that the total heap size is (and stays) a multiple of2 * size_of::<usize>()
.For more information
If you have any questions or comments about this advisory:
Acknowledgements
This issue was responsibly reported by Evan Richter at ForAllSecure and found with Mayhem and cargo fuzz.
Release Notes
phil-opp/linked-list-allocator (linked_list_allocator)
v0.10.2
Compare Source
Fix for potential out-of-bound writes that were possible on
Heap
initialization andHeap::extend
. See the security advisory for details. The issues were fixed in the following way:2 * size_of::<usize>
and3 * size_of::<usize>
.extend
method now panics when trying to extend an unitialized heap.size_of::<usize>() * 2
are now buffered internally and not added to the list directly. The buffered region will be merged with futureextend
calls.size()
method now returns the usable size of the heap, which might be slightly smaller than thetop() - bottom()
difference because of alignment constraints.v0.10.1
Compare Source
v0.10.0
Compare Source
*mut u8
instead ofusize
(#62)Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.