Hugepage rs: `hugepage_rs::alloc` may cause undefined behavior with zero-sized layouts from safe code
Affects hugepage-rsSource GCVE Database
Rated High by Threat Radar's AI analysis
- Patch
- Available – fixed in 0.1.2
Data as of 24 Nov 2026, 10:24 UTC
What to do
Upgrade hugepage-rs to 0.1.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
crates.iohugepage-rspkg:cargo/hugepage-rsOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade to hugepage-rs version 0.1.2 or later, where the alloc function is marked unsafe and requires non-zero layout sizes, preventing unsafe usage through safe code. Applying this official fix fully mitigates the issue.
Description
The hugepage-rs crate contained a safe function, hugepage_rs::alloc, that allowed zero-sized memory layout allocations, violating the safety requirements of the underlying GlobalAlloc::alloc method. This flaw exposed unsafe allocation preconditions through safe Rust code, breaking Rust's soundness guarantees. The issue was fixed in version 0.1.2 by marking the alloc function as unsafe and documenting the requirement for non-zero layout sizes.
References
- crates.io/crates/hugepage-rs (opens in a new tab)
- rustsec.org/advisories/RUSTSEC-2026-0598.html (opens in a new tab)
- github.com/cppcoffee/hugepage-rs/issues/7 (opens in a new tab)
- github.com/cppcoffee/hugepage-rs/pull/8 (opens in a new tab)
- github.com/cppcoffee/hugepage-rs/releases/tag/v0.1.2 (opens in a new tab)