{"answers":{"affected":"3 open source packages ship an affected version, including kvm-ioctls.","exploited":"There is no known exploitation of GHSA-3qx8-rv27-j6gp in the wild and no public exploit code.","fix":"Upgrade kvm-ioctls to 0.19.1 or later.","what":"GHSA-3qx8-rv27-j6gp is a vulnerability in kvm-ioctls, published on 5 Dec 2024."},"fix_prompt":"Check this codebase for GHSA-3qx8-rv27-j6gp and fix it if it is affected.\n\nWhat it is: GHSA-3qx8-rv27-j6gp is a vulnerability in kvm-ioctls, published on 5 Dec 2024. \nExploitation: There is no known exploitation of GHSA-3qx8-rv27-j6gp in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- kvm-ioctls (crates.io): affected all versions; fixed in 0.19.1\n- kvm-ioctls (crates.io): affected all versions; fixed in 0.19.1\n- kvm-ioctls (crates.io): affected from 0.0.0-0; fixed in 0.19.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-3qx8-rv27-j6gp/ (Markdown: https://insights.sbomify.com/GHSA-3qx8-rv27-j6gp/index.md)","id":"GHSA-3qx8-rv27-j6gp","markdown":"https://insights.sbomify.com/GHSA-3qx8-rv27-j6gp/index.md","name":"GHSA-3qx8-rv27-j6gp","record":{"aliases":["RUSTSEC-2024-0428"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["other"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust KVM library","requires_auth":"none","summary":"Undefined behavior in KVM device creation causes incorrect file descriptor handling, potentially leading to logic errors or crashes in virtualization applications.","user_interaction":"not_required","vuln_class":"other"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"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.","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Undefined behaviour in `kvm_ioctls::ioctls::vm::VmFd::create_device`","id":"GHSA-3qx8-rv27-j6gp","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"other","year":"2024"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.19.1"],"introduced":["0"],"last_affected":[],"package":"kvm-ioctls","purl":null,"source":"GHSA-3qx8-rv27-j6gp"},{"ecosystem":"crates.io","fixed":["0.19.1"],"introduced":["0"],"last_affected":[],"package":"kvm-ioctls","purl":"pkg:cargo/kvm-ioctls","source":"GHSA-3qx8-rv27-j6gp"},{"ecosystem":"crates.io","fixed":["0.19.1"],"introduced":["0.0.0-0"],"last_affected":[],"package":"kvm-ioctls","purl":"pkg:cargo/kvm-ioctls","source":"RUSTSEC-2024-0428"}],"products":null,"published":"2024-12-05","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Undefined behavior in KVM device creation causes incorrect file descriptor handling, potentially leading to logic errors or crashes in virtualization applications.","url":"https://insights.sbomify.com/GHSA-3qx8-rv27-j6gp/"}