CVE-2026-98795: net: sparx5: skip ptp deinit if init was skipped
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: sparx5: skip ptp deinit if init was skipped
sparx5_ptp_init() returns early on the base lan969x variants because they do not have the SPX5_FEATURE_PTP flag. It also returns early when no "ptp" interrupt is described. Unbinding the driver then causes a NULL pointer dereference when cleaning up uninitialized tx_skbs queues:
Unable to handle kernel NULL pointer dereference at virtual address
0000000000000008
Call trace:
skb_queue_purge_reason+0x68/0x120 (P)
sparx5_ptp_deinit+0x64/0xc0
mchp_sparx5_remove+0x38/0x70
platform_remove+0x20/0x30
device_remove+0x4c/0x80Before per-port tx_skbs were added, a NULL dereference would have happened when calling ptp_clock_unregister() on the never-registered PTP clocks.
Fix by returning early in sparx5_ptp_deinit() if PTP is not used.
The Linux kernel CVE team has assigned CVE-2026-98795 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.18 with commit 0933bd04047c3b96ba49545a8f91e7e6f8f666ff and fixed in 6.18.56 with commit 35c706d6eb1963735814c5f5bb2674a96eacf3cc Issue introduced in 5.18 with commit 0933bd04047c3b96ba49545a8f91e7e6f8f666ff and fixed in 7.2.10 with commit 2879b65bfa548e10d59c5fba91d17f8a00cd7029 Issue introduced in 5.18 with commit 0933bd04047c3b96ba49545a8f91e7e6f8f666ff and fixed in 7.3-rc6 with commit 0d2c49915bc3aea4521cda5e4d42f24f63b94585
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-98795
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/microchip/sparx5/sparx5_ptp.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/35c706d6eb1963735814c5f5bb2674a96eacf3cc https://git.kernel.org/stable/c/2879b65bfa548e10d59c5fba91d17f8a00cd7029 https://git.kernel.org/stable/c/0d2c49915bc3aea4521cda5e4d42f24f63b94585