{"id":"RUSTSEC-2026-0598","aliases":["RUSTSEC-2026-0598"],"related":[],"kind":"vulnerability","state":"published","title":"`hugepage_rs::alloc` may cause undefined behavior with zero-sized layouts from safe code","summary":"`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.\n`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`.\nAffected versions therefore exposed an unsafe allocation precondition through safe Rust code, violating Rust's soundness guarantees.\n\nThe upstream repository fixed this in version `0.1.2` by marking `alloc` as unsafe and documenting its non-zero-layout requirement.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"`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.\n`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`.\nAffected versions therefore exposed an unsafe allocation precondition through safe Rust code, violating Rust's soundness guarantees.\n\nThe upstream repository fixed this in version `0.1.2` by marking `alloc` as unsafe and documenting its non-zero-layout requirement.","format":"markdown","source":"rustsec"}],"published":"2026-10-27T12:00:00.000Z","modified":"2026-11-24T09:30:02.332Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.1.2"}],"ecosystem":"crates.io","package":"hugepage-rs","purl":"pkg:cargo/hugepage-rs","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/hugepage-rs","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0598.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/cppcoffee/hugepage-rs/issues/7","tags":["report"],"sources":["rustsec"]},{"url":"https://github.com/cppcoffee/hugepage-rs/pull/8","tags":["web"],"sources":["rustsec"]},{"url":"https://github.com/cppcoffee/hugepage-rs/releases/tag/v0.1.2","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0598","url":"https://rustsec.org/advisories/RUSTSEC-2026-0598.html","licence":"CC0-1.0","modified":"2026-11-24T09:30:02.332Z"}],"updatedAt":"2026-11-25T22:56:43.526Z"}