{"id":"GHSA-3qx8-rv27-j6gp","aliases":["GHSA-3qx8-rv27-j6gp","RUSTSEC-2024-0428"],"related":[],"kind":"vulnerability","state":"published","title":"Undefined behaviour in `kvm_ioctls::ioctls::vm::VmFd::create_device`","summary":"An issue was identified in the `VmFd::create_device function`, leading to undefined behavior and miscompilations on rustc 1.82.0 and newer due to the function's violation of Rust's pointer safety rules.\n\nThe function downcasted a mutable reference to its `struct kvm_create_device` argument to an immutable pointer, and then proceeded to pass this pointer to a mutating system call. Rustc 1.82.0 and newer elides subsequent reads of this structure's fields, meaning code will not see the value written by the kernel into the `fd` member. Instead, the code will observe the value that this field was initialized to prior to calling `VmFd::create_device` (usually, 0).\n\nThe issue started in kvm-ioctls 0.1.0 and was fixed in 0.19.1 by correctly using\na mutable pointer.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"An issue was identified in the `VmFd::create_device function`, leading to undefined behavior and miscompilations on rustc 1.82.0 and newer due to the function's violation of Rust's pointer safety rules.\n\nThe function downcasted a mutable reference to its `struct kvm_create_device` argument to an immutable pointer, and then proceeded to pass this pointer to a mutating system call. Rustc 1.82.0 and newer elides subsequent reads of this structure's fields, meaning code will not see the value written by the kernel into the `fd` member. Instead, the code will observe the value that this field was initialized to prior to calling `VmFd::create_device` (usually, 0).\n\nThe issue started in kvm-ioctls 0.1.0 and was fixed in 0.19.1 by correctly using\na mutable pointer.","format":"markdown","source":"ghsa"}],"published":"2024-12-05T12:00:00.000Z","modified":"2025-10-28T06:29:22.787Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-843"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.19.1"}],"ecosystem":"crates.io","package":"kvm-ioctls","purl":"pkg:cargo/kvm-ioctls","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.19.1"}],"ecosystem":"crates.io","package":"kvm-ioctls","purl":"pkg:cargo/kvm-ioctls","source":"rustsec"}],"references":[{"url":"https://github.com/rust-vmm/kvm/pull/298","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-vmm/kvm-ioctls","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0428.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/kvm-ioctls","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3qx8-rv27-j6gp","url":"https://github.com/advisories/GHSA-3qx8-rv27-j6gp","licence":"CC-BY-4.0","modified":"2025-10-28T06:29:22.787Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2024-0428","url":"https://rustsec.org/advisories/RUSTSEC-2024-0428.html","licence":"CC0-1.0","modified":"2025-10-28T06:29:22.787Z"}],"updatedAt":"2026-11-25T22:56:43.232Z"}