From 7b511bb302947a5f26aa803ffbcbed5dfc15c891 Mon Sep 17 00:00:00 2001 From: sisy2020 <78672130+sisy2020@users.noreply.github.com> Date: Tue, 12 May 2026 00:20:26 +0800 Subject: [PATCH 1/2] Add advisory for vku VMABuffer::set_data unsoundness --- crates/vku/RUSTSEC-0000-0000.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 crates/vku/RUSTSEC-0000-0000.md diff --git a/crates/vku/RUSTSEC-0000-0000.md b/crates/vku/RUSTSEC-0000-0000.md new file mode 100644 index 0000000000..9992fbec2d --- /dev/null +++ b/crates/vku/RUSTSEC-0000-0000.md @@ -0,0 +1,26 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "vku" +date = "2025-04-23" +url = "https://github.com/ArrowMaxGithub/vku/issues/5" +references = ["https://github.com/ArrowMaxGithub/vku/commit/ce02c19"] +informational = "unsound" +categories = ["memory-corruption"] + +[affected.functions] +"vku::VMABuffer::set_data" = ["<= 0.3.0"] + +[versions] +patched = [">= 0.4.0"] +``` + +# `VMABuffer::set_data` may allow out-of-bounds writes from safe code + +`VMABuffer::set_data` was a publicly accessible safe function. It accepted an arbitrary `offset` and a data slice, then used the offset in unsafe pointer arithmetic before copying the slice into a mapped allocation. + +Affected versions did not check that the requested write range fit within the allocation before calling `ptr.add(offset)` and `copy_from_nonoverlapping`. Safe Rust code could therefore trigger an out-of-bounds write by passing an offset outside the mapped allocation. + +This makes the safe API unsound, since callers can trigger undefined behavior without using `unsafe`. + +Version `0.4.0` added a bounds check before performing the pointer arithmetic and copy. From eb4ec5e650abed5f8e8d977629c9f714e4f07e37 Mon Sep 17 00:00:00 2001 From: sisy2020 <78672130+sisy2020@users.noreply.github.com> Date: Tue, 12 May 2026 00:27:56 +0800 Subject: [PATCH 2/2] Add advisory for vku VMABuffer::set_data unsoundness --- crates/vku/RUSTSEC-0000-0000.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/vku/RUSTSEC-0000-0000.md b/crates/vku/RUSTSEC-0000-0000.md index 9992fbec2d..46a0ceeaf5 100644 --- a/crates/vku/RUSTSEC-0000-0000.md +++ b/crates/vku/RUSTSEC-0000-0000.md @@ -4,7 +4,7 @@ id = "RUSTSEC-0000-0000" package = "vku" date = "2025-04-23" url = "https://github.com/ArrowMaxGithub/vku/issues/5" -references = ["https://github.com/ArrowMaxGithub/vku/commit/ce02c19"] +references = ["https://github.com/ArrowMaxGithub/vku/commit/ce02c19ec35e5ee84c00ec5005be9d6d44599b5f"] informational = "unsound" categories = ["memory-corruption"]