ptp: fix use-after-free in extts_fifo_show() reading tsevqs unlocked
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| LinuxLinux | — | Not listed |
| LinuxKernel |
≥ 6.7.0, < 6.12.118→ 6.12.118 ≥ 6.13.0, < 6.18.64→ 6.18.64 ≥ 6.19.0, < 7.3.5→ 7.3.5 |
6.12.118 6.18.64 7.3.5 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- BellSoft Alpaquita BELL-CVE-2026-99755 linux-lts Fix available
- Debian DEBIAN-CVE-2026-99755 linux-6.12, linux Fix available
- Ubuntu UBUNTU-CVE-2026-99755 linux-xilinx, linux-vmware, linux-starfive-6.5 +139 more No fixed version in this record
Original description The description as published by the source.
In the Linux kernel, the following vulnerability has been resolved:
ptp: fix use-after-free in extts_fifo_show() reading tsevqs unlocked
extts_fifo_show() walks ptp->tsevqs with list_count_nodes() and then
list_first_entry() without holding ptp->tsevqs_lock, the spinlock that
"protects tsevqs from concurrent access". Every other accessor of the
list honours it: ptp_open() (list_add_tail), ptp_release() (list_del
followed by kfree of the per-fd queue), ptp_clock_release() and
ptp_clock_event() all take tsevqs_lock. extts_fifo_show() 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 tsevqs_lock:
scoped_guard(spinlock_irq, &ptp->tsevqs_lock)
list_del(&queue->qlist);
bitmap_free(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 list_count_nodes() walk into the
queue that close() is removing and freeing, dereferencing freed memory
(use-after-free) or a poisoned list pointer.
Take tsevqs_lock around the list walk. The fifo only ever draws from the
first queue, which is the registration-time queue created in
ptp_clock_register() and freed only in ptp_clock_release(); that cannot
run while the sysfs attribute is being read, so the dequeue from
queue->buf under queue->lock may stay outside tsevqs_lock and the lock
order is unchanged.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory nvd.nist.gov
- package git.kernel.org
- REDHAT Red Hat
- web git.kernel.org
- web git.kernel.org
- web git.kernel.org
- web git.kernel.org
- web github.com