CVE-2026-99520: pps: generators: fix use-after-free when closing a removed device
In the Linux kernel, the following vulnerability has been resolved:
pps: generators: fix use-after-free when closing a removed device
The cdev of a PPS generator is embedded in struct ppsgendevice, but nothing ties the lifetime of that structure to the cdev: ppsgen is freed by the release function of its device, and an open file holds a device reference only until ppsgencdevrelease() drops it.
When the generator is unregistered while /dev/pps-genN is open, that putdevice() drops the last reference and frees ppsgen, and fput() then calls cdevput() on the freed cdev:
BUG: KASAN: slab-use-after-free in cdevput+0x53/0x60 Read of size 8 at addr ffff88801383e138 by task ppsgen64/149 Call Trace: cdevput+0x53/0x60 fput+0x745/0xad0 fputclosesync+0xd9/0x1b0 x64sysclose+0x86/0xf0 ... Freed by task 149: kfree+0x25a/0x6d0 devicerelease+0xca/0x3c0 kobjectput+0x169/0x320 ppsgencdevrelease+0x51/0x80 fput+0x36a/0xad0
pps.c had the same bug, fixed in commit c79a39dc8d06 ("pps: Fix a use-after-free").
Fix it the usual way: embed the struct device in ppsgendevice and register both with cdevdeviceadd(). This makes the device the parent of the cdev, so the cdev holds a device reference until the last file is closed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.3-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.4-1Fixed in 7.3.5-1 - Compensating control
Embed struct device in pps_gen_device and register the device and cdev together with cdev_device_add() so the device reference keeps the structure alive until the last open file is closed.