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

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-10-27T12:00:00.000Z
- Modified: 2026-11-24T09:30:02.332Z

## 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.

(As written by RustSec Advisory Database.)

## Affected

- hugepage-rs (crates.io): from 0.0.0-0 before 0.1.2

## References

- <https://crates.io/crates/hugepage-rs> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0598.html> (advisory)
- <https://github.com/cppcoffee/hugepage-rs/issues/7> (report)
- <https://github.com/cppcoffee/hugepage-rs/pull/8> (web)
- <https://github.com/cppcoffee/hugepage-rs/releases/tag/v0.1.2> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0598](https://rustsec.org/advisories/RUSTSEC-2026-0598.html), CC0-1.0, modified 2026-11-24

---

Page: https://cve.day/RUSTSEC-2026-0598 · Whole record: https://cve.day/RUSTSEC-2026-0598.json · Rebuilt by cve.day 2026-11-25T22:56:43.526Z
