CVE-2026-52971: net: ena: PHC: Fix potential use-after-free in get_timestamp
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: ena: PHC: Fix potential use-after-free in get_timestamp
Move the phc->active check and resp pointer assignment to after acquiring the spinlock. Previously, phc->active was checked without holding the lock, and resp was cached from ena_dev->phc.virt_addr before the lock was acquired.
If ena_com_phc_destroy() runs between the lockless active check and the lock acquisition, it sets active=false, releases the lock, frees the DMA memory, and sets virt_addr=NULL. The get_timestamp path would then read a NULL virt_addr and dereference it.
With both the active check and the pointer read under the lock, destroy cannot free the memory while get_timestamp is using it.
The Linux kernel CVE team has assigned CVE-2026-52971 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.17 with commit e0ea34158ee8c4f7536cd781010339ff28c0d24c and fixed in 6.18.33 with commit 95e8ae9af2a61b4e72f5c585bf4c7d8aaf2a2c98 Issue introduced in 6.17 with commit e0ea34158ee8c4f7536cd781010339ff28c0d24c and fixed in 7.0.10 with commit ca9ed40f28949353911dcb524ff8fff2f3409c97 Issue introduced in 6.17 with commit e0ea34158ee8c4f7536cd781010339ff28c0d24c and fixed in 7.1 with commit e42c755582f0960e684298762f0ab927b3778376
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-52971
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/net/ethernet/amazon/ena/ena_com.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/95e8ae9af2a61b4e72f5c585bf4c7d8aaf2a2c98 https://git.kernel.org/stable/c/ca9ed40f28949353911dcb524ff8fff2f3409c97 https://git.kernel.org/stable/c/e42c755582f0960e684298762f0ab927b3778376