HIGH Introduced in 6.18
rust IrqRegistration UninitRead
CVE-2026-98938
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: rust: irq: pass RegistrationInner as cookie to request_irq With commit ba268514ea14 ("rust: devres: fix race condition due to nesting"), Devres::new() returns Result<Self> by value instead of initializing in-place via PinInit. Because request_irq() is called inside Devres::new(), registration.inner is still uninitialized when the IRQ is enabled, so accessing registration.inner.device() in the IRQ callback can read uninitialized memory. Fix this by storing the Device and handler pointer in RegistrationInner and passing RegistrationInner as the IRQ cookie after its fields are initialized. This is not needed in mainline because commit 98c63ce4d760 ("rust: irq: make Registration compatible with lifetime-bound drivers") removed Devres from irq::Registration and moved request_irq() after all fields are initialized.
02KernelScan AI Analysis
Risk summary
A local attacker who can trigger an interrupt on a device driven by a Rust kernel driver can exploit a race window during IRQ registration to read uninitialized kernel memory, potentially leaking sensitive pointers and achieving arbitrary code execution. The vulnerability affects kernels 6.18 through 7.2.9 built with Rust support (CONFIG_RUST) when a Rust driver using the IRQ registration API is loaded.
Vulnerability analysis
A change to the Rust kernel's device resource (Devres) initialization altered the timing of when the IRQ registration structure becomes fully initialized. Previously, the structure was initialized in-place before the IRQ was enabled; after the change, the IRQ is requested while the inner registration fields — including the device reference and handler pointer — are still uninitialized. If an interrupt fires during this narrow window, the callback dereferences those uninitialized fields, leading to uncontrolled memory reads and potential control-flow hijacking. The fix moves the device and handler pointers into the inner registration structure and passes that structure as the IRQ cookie only after its fields are fully populated, ensuring the callback always sees valid data. Exploitation requires a local user able to interact with a Rust-driven device (e.g., via a device file or hardware trigger) and is complicated by the tight race window, making reliable exploitation dependent on heap layout and timing.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 7.2 | 6.18 | 7.2.10 | 9a7931e847f3 |