Skip to content

GHSA-wm8x-php5-hvq6 Maligned causes incorrect deallocation

Unknown
Published
Updated
Exploit status
No public exploit known

Description

maligned::align_first manually allocates with an alignment larger than T, and then uses Vec::from_raw_parts on that allocation to get a Vec<T>.

GlobalAlloc::dealloc requires that the layout argument must be the same layout that was used to allocate that block of memory.

When deallocating, Box and Vec may not respect the specified alignment and can cause undefined behavior.

Upgrade path

1 package: 0 fixed, 1 partially fixed.

PackageAffectedFixed inStatus
crates.io maligned(crates.io) <= 0.2.1; >= 0.0.0-0 after 0.2.1 Partially fixed

Affected products

ProductAffected versionsFixed in
crates.io maligned(crates.io) <= 0.2.1 No fix listed
crates.io maligned(crates.io) >= 0.0.0-0 No fix listed

References