CVE-2026-99755: ptp: fix use-after-free in extts_fifo_show() reading tsevqs unlocked
In the Linux kernel, the following vulnerability has been resolved:
ptp: fix use-after-free in exttsfifoshow() reading tsevqs unlocked
exttsfifoshow() walks ptp->tsevqs with listcountnodes() and then listfirstentry() without holding ptp->tsevqslock, the spinlock that "protects tsevqs from concurrent access". Every other accessor of the list honours it: ptpopen() (listaddtail), ptprelease() (listdel followed by kfree of the per-fd queue), ptpclockrelease() and ptpclockevent() all take tsevqslock. exttsfifoshow() is the only one that does not.
A per-fd timestamp queue is appended to tsevqs on open("/dev/ptpN") and removed and freed on close(), both under tsevqslock:
scopedguard(spinlockirq, &ptp->tsevqslock) listdel(&queue->qlist); bitmapfree(queue->mask); kfree(queue);
So a read of /sys/class/ptp/ptpN/fifo running concurrently with a close() of a /dev/ptpN fd can have listcountnodes() walk into the queue that close() is removing and freeing, dereferencing freed memory (use-after-free) or a poisoned list pointer.
Take tsevqslock around the list walk. The fifo only ever draws from the first queue, which is the registration-time queue created in ptpclockregister() and freed only in ptpclockrelease(); that cannot run while the sysfs attribute is being read, so the dequeue from queue->buf under queue->lock may stay outside tsevqslock and the lock order is unchanged.
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.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Compensating control
Take ptp->tsevqs_lock around the list walk in extts_fifo_show(), for example with scoped_guard(spinlock_irq, &ptp->tsevqs_lock).
Frequently Asked Questions
Does the available information identify affected or fixed kernel versions?
No. The record identifies the affected software as linux/kernel and provides three stable-tree fix references, but it does not specify affected versions, fixed versions, or configuration prerequisites.