{"id":"GHSA-3qx8-rv27-j6gp","aliases":["RUSTSEC-2024-0428"],"status":"published","title":"Undefined behaviour in `kvm_ioctls::ioctls::vm::VmFd::create_device`","description":"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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-843"],"published":"2024-12-05T12:00:00Z","modified":"2025-10-28T06:29:22Z","fixes":[{"ecosystem":"crates.io","package":"kvm-ioctls","fixed_in":["0.19.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"kvm-ioctls","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.19.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"kvm-ioctls","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.19.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"kvm-ioctls","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.19.1"}]}]}],"references":[{"url":"https://github.com/rust-vmm/kvm/pull/298","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0428.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-3qx8-rv27-j6gp"},{"url":"https://github.com/rust-vmm/kvm-ioctls","tags":["package"]},{"url":"https://crates.io/crates/kvm-ioctls","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-3qx8-rv27-j6gp","title":"Undefined behaviour in `kvm_ioctls::ioctls::vm::VmFd::create_device`","description":"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.\n","status":"published","published":"2024-12-23T19:26:37Z","modified":"2024-12-23T19:26:38Z","cwes":["CWE-843"],"updated_at":"2026-11-02T14:38:26.167657Z"}],"osv":[{"id":"GHSA-3qx8-rv27-j6gp","title":"Undefined behaviour in `kvm_ioctls::ioctls::vm::VmFd::create_device`","description":"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.\n","status":"published","published":"2024-12-23T19:26:37Z","modified":"2025-10-28T06:29:22.787282Z","cwes":["CWE-843"],"updated_at":"2026-11-02T15:46:36.092962Z"},{"id":"RUSTSEC-2024-0428","title":"Undefined behaviour in `kvm_ioctls::ioctls::vm::VmFd::create_device`","description":"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.","status":"published","published":"2024-12-05T12:00:00Z","modified":"2025-10-28T06:29:22.787282Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
