CVE-2026-98841: virt: vmgenid: set driver_data before registering notification handlers
In the Linux kernel, the following vulnerability has been resolved:
virt: vmgenid: set driverdata before registering notification handlers
Both probe paths register their notification handler before assigning driverdata, which the handler dereferences.
In the devicetree path, the notification IRQ can fire as soon as devmrequestirq() registers the handler: the interrupt may already be pending at probe time, for example when a VMM injects the generation-changed notification while restoring a guest from a snapshot that was taken before the driver had probed (Firecracker does exactly this on snapshot restore). The IRQ is also requested with IRQFSHARED, so another device sharing the line can trigger the handler just as early. The handler then calls vmgenidnotify(), which dereferences the still-NULL driverdata and panics:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.18.38+ #1 PREEMPT(none) Hardware name: linux,dummy-virt (DT) pc : vmgenidnotify.isra.0+0x24/0x8c lr : vmgenidofirqhandler+0x14/0x34 Call trace: vmgenidnotify.isra.0+0x24/0x8c (P) vmgenidofirqhandler+0x14/0x34 handleirqeventpercpu+0x44/0x1bc handleirqevent+0x4c/0xb4 handlefasteoiirq+0xf8/0x1f8
The ACPI path has the same ordering problem: the handler is installed with acpiinstallnotifyhandler() before driverdata is assigned. ACPI notifications are dispatched asynchronously from a workqueue, so the window is narrow, but a notification arriving between the two calls hits the same NULL dereference.
Assign driverdata before registering the handlers. The state is fully initialized at that point, so the handlers are safe to run. Should registration fail, the probe error path leaves no dangling pointer behind: the driver core clears driverdata in deviceunbindcleanup().
Affected Software
Event History
Frequently Asked Questions
Which environments are most likely to encounter this issue?
The devicetree probe path is specifically exposed because its IRQ handler can run immediately after devm_request_irq() registers it. This can occur during VM snapshot restore when a VMM injects a generation-change notification before the driver has finished probing; Firecracker is identified as doing this on snapshot restore.
Does exploitation require a malicious guest workload?
The described trigger is an interrupt arriving during driver initialization, not guest workload activity. A pending generation-change notification or activity from another device on the shared IRQ line can cause the handler to run before driver_data is assigned.
How can I tell whether a system has hit this problem?
The failure manifests as a kernel NULL pointer dereference and panic in vmgenid_notify(), potentially with vmgenid_of_irq_handler in the call trace. The example reports a dereference at virtual address 0000000000000010 during early boot from the swapper/0 context.