CVE-2026-31487 spi: use generic driver_override infrastructure
A race condition in the Linux kernel SPI subsystem allows a use-after-free, potentially enabling local attackers to execute code or escalate privileges.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-31487?
CVE-2026-31487 is a medium-severity use after free vulnerability in Linux kernel, published on 22 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
spi: use generic driver_override infrastructure
When a driver is probed through __driver_attach(), the bus' match() callback is called without the device lock held, thus accessing the driver_override field without a lock, which can cause a UAF.
Fix this by using the driver-core driver_override infrastructure taking care of proper locking internally.
Note that calling match() from __driver_attach() without the device lock held is intentional. [1]
Also note that we do not enable the driver_override feature of struct bus_type, as SPI - in contrast to most other buses - passes "" to sysfs_emit() when the driver_override pointer is NULL. Thus, printing "\n" instead of "(null)\n".
Weakness: CWE-667
Which versions are affected by CVE-2026-31487?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2026-31487?
Apply the vendor's patch.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2026-31487 being exploited?
There is no known exploitation of CVE-2026-31487 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-83195, BELL-CVE-2026-31487, DEBIAN-CVE-2026-31487, GHSA-vq56-9rjp-57fc, ROOT-OS-DEBIAN-11-CVE-2026-31487, ROOT-OS-DEBIAN-12-CVE-2026-31487 and 4 more.