Summary
Undefined behaviour in kvmioctls::ioctls::vm::VmFd::createdevice
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.
The 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).
The issue started in kvm-ioctls 0.1.0 and was fixed in 0.19.1 by correctly using
a mutable pointer.
Impact
An object is accessed using a type that is incompatible with its actual type, causing the runtime to interpret memory incorrectly. Typical impact: memory safety violations, unexpected behavior, or code execution.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-3QX8-RV27-J6GP? GHSA-3QX8-RV27-J6GP is a medium-severity type confusion vulnerability in kvm-ioctls (rust), affecting versions < 0.19.1. It is fixed in 0.19.1. An object is accessed using a type that is incompatible with its actual type, causing the runtime to interpret memory incorrectly.
- Which versions of kvm-ioctls are affected by GHSA-3QX8-RV27-J6GP? kvm-ioctls (rust) versions < 0.19.1 is affected.
- Is there a fix for GHSA-3QX8-RV27-J6GP? Yes. GHSA-3QX8-RV27-J6GP is fixed in 0.19.1. Upgrade to this version or later.
- Is GHSA-3QX8-RV27-J6GP exploitable, and should I be worried? Whether GHSA-3QX8-RV27-J6GP is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-3QX8-RV27-J6GP is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-3QX8-RV27-J6GP? Upgrade
kvm-ioctlsto 0.19.1 or later.