Skip to content

RUSTSEC-2026-0598 `hugepage_rs::alloc` may cause undefined behavior with zero-sized layouts from safe code

Unknown
Published
Updated
Exploit status
No public exploit known

Description

hugepage_rs::alloc was a publicly accessible safe function that forwarded a Layout to the hugepage allocator's GlobalAlloc::alloc implementation without enforcing its safety requirements.
GlobalAlloc::alloc requires the layout size to be non-zero. However, the safe wrapper allowed callers to pass a zero-sized Layout, violating this precondition without using unsafe.
Affected versions therefore exposed an unsafe allocation precondition through safe Rust code, violating Rust's soundness guarantees.

The upstream repository fixed this in version 0.1.2 by marking alloc as unsafe and documenting its non-zero-layout requirement.

Upgrade path

1 package: 1 fixed.

PackageAffectedFixed inStatus
crates.io hugepage-rs(crates.io) >= 0.0.0-0, < 0.1.2 0.1.2 Fixed

Affected products

ProductAffected versionsFixed in
crates.io hugepage-rs(crates.io) >= 0.0.0-0, < 0.1.2 0.1.2

References