KernelScan.io

HIGH Introduced in 7.1

dsa StatsPoll UAF

CVE-2026-98305

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI6.9MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: net: dsa: mxl862xx: disable the stats poll on teardown mxl862xx_setup() arms the stats poll before mxl862xx_setup_mdio(), and nothing stops it until dsa_register_switch() has returned an error to mxl862xx_probe(). DSA frees the dsa_port list before it returns, so a poll that fires once .setup or a later step of dsa_tree_setup() has failed walks freed ports. On shutdown the user ports stay registered, and the WORK_STOPPED flag test in mxl862xx_get_stats64() is not atomic with the cancel in mxl862xx_shutdown(), so a re-arm that read the flag before it was set queues the poll after cancel_delayed_work_sync() has returned. Arm the poll once .setup has succeeded and stop it from a .teardown op, which DSA calls on unregister and after a failed registration, in both cases before it frees the ports. Use disable_delayed_work_sync() there and in shutdown(): it drains a running poll as the cancel did and turns every later attempt to queue the work into a no-op, so the re-arm cannot bring the poll back. remove() and the probe error path only set WORK_STOPPED, which crc_err_work tests before it walks the ports.

02

Engine v0.7.0

Risk summary

Systems using the mxl862xx DSA Ethernet switch driver may suffer a use-after-free when the periodic stats poll fires after DSA has freed port structures during a failed probe or concurrent teardown. A local user reading network statistics can re-arm the poll during a race window with shutdown, causing the kernel to walk freed memory — potentially crashing the system or corrupting kernel heap data. This requires the specific mxl862xx switch hardware to be present.

Affecteddrivers/net/dsa/mxl862xx/mxl862xx.c (net/dsa/mxl862xx DSA switch driver)

Vulnerability analysis

The mxl862xx DSA switch driver arms a periodic statistics poll during device setup, before setup fully completes, and does not stop it if registration fails — so when DSA frees the port list after a failed probe, an in-flight poll walks freed port structures. On shutdown, the flag check that is supposed to prevent re-arming is not atomic with the work cancellation, so a stats callback that read the flag before it was set can queue the poll after cancellation has already returned, again accessing freed ports. The fix moves the poll arming to after setup succeeds, adds a dedicated teardown operation that DSA calls before freeing ports, and replaces the non-atomic cancel with a disable-and-drain call that also turns all future re-arm attempts into no-ops. The bug is reachable on any system with the mxl862xx switch hardware; the race on shutdown is triggered by a local user reading network statistics concurrently with a device teardown initiated by an administrator.

03

BranchIntroducedFixed inPatch commit
7.27.17.2.897df811a11d4
mainline7.17.39e92ad4630f5