CVE-2025-38440: net/mlx5e: Fix race between DIM disable and net_dim()
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5e: Fix race between DIM disable and net_dim()
There's a race between disabling DIM and NAPI callbacks using the dim
pointer on the RQ or SQ.
If NAPI checks the DIM state bit and sees it still set, it assumes
`rq->dim` or `sq->dim` is valid. But if DIM gets disabled right after
that check, the pointer might already be set to NULL, leading to a NULL
pointer dereference in net_dim().
Fix this by calling `synchronize_net()` before freeing the DIM context.
This ensures all in-progress NAPI callbacks are finished before the
pointer is cleared.
Kernel log:
BUG: kernel NULL pointer dereference, address: 0000000000000000
...
RIP: 0010:net_dim+0x23/0x190
...
Call Trace:
<TASK>
? __die+0x20/0x60
? page_fault_oops+0x150/0x3e0
? common_interrupt+0xf/0xa0
? sysvec_call_function_single+0xb/0x90
? exc_page_fault+0x74/0x130
? asm_exc_page_fault+0x22/0x30
? net_dim+0x23/0x190
? mlx5e_poll_ico_cq+0x41/0x6f0 [mlx5_core]
? sysvec_apic_timer_interrupt+0xb/0x90
mlx5e_handle_rx_dim+0x92/0xd0 [mlx5_core]
mlx5e_napi_poll+0x2cd/0xac0 [mlx5_core]
? mlx5e_poll_ico_cq+0xe5/0x6f0 [mlx5_core]
busy_poll_stop+0xa2/0x200
? mlx5e_napi_poll+0x1d9/0xac0 [mlx5_core]
? mlx5e_trigger_irq+0x130/0x130 [mlx5_core]
__napi_busy_loop+0x345/0x3b0
? sysvec_call_function_single+0xb/0x90
? asm_sysvec_call_function_single+0x16/0x20
? sysvec_apic_timer_interrupt+0xb/0x90
? pcpu_free_area+0x1e4/0x2e0
napi_busy_loop+0x11/0x20
xsk_recvmsg+0x10c/0x130
sock_recvmsg+0x44/0x70
__sys_recvfrom+0xbc/0x130
? __schedule+0x398/0x890
__x64_sys_recvfrom+0x20/0x30
do_syscall_64+0x4c/0x100
entry_SYSCALL_64_after_hwframe+0x4b/0x53
...
---[ end trace 0000000000000000 ]---
...
---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
Security readout for executives and security teams
Plain-English summary
A timing flaw in the Linux mlx5e network driver can dereference a cleared pointer while processing network activity, causing a kernel crash. The demonstrated business impact is loss of availability on affected systems. The supplied CVSS score is 7.8, but exposure depends on the installed kernel and use of mlx5e hardware and DIM functionality.
Executive priority
Treat this as a high-priority availability issue for critical Linux systems using mlx5e networking. Patch confirmed-exposed hosts through normal kernel maintenance promptly, with accelerated handling where a kernel panic would disrupt essential services. Broad emergency action across unrelated Linux systems is not supported by the supplied evidence.
Technical view
NAPI may observe DIM as enabled while another path disables DIM, frees its context, and clears the RQ or SQ pointer. The callback can then pass NULL to net_dim(), producing a kernel panic. The upstream fix calls synchronize_net() before freeing the DIM context so active NAPI callbacks finish first.
Likely exposure
Potentially exposed systems run an affected Linux kernel with the mlx5e driver and DIM functionality in use. The supplied affected-version data includes 6.10, 6.12.39, 6.15.7, and 6.16, but branch boundaries are unclear; confirm exact status with the kernel or distribution vendor.
Exploitation context
The supplied CVSS vector describes local access, low privileges, low complexity, and no user interaction. No source in the bundle reports active exploitation, and the CVE is not identified as CISA KEV. The documented outcome is a NULL-pointer dereference and kernel panic during a DIM-disable race.
Researcher notes
The race is a lifetime-ordering defect between DIM teardown and NAPI callbacks. synchronize_net() supplies the required network-side quiescence before context release. The bundle demonstrates a crash but provides no exploit evidence or reliable distribution-specific affected matrix. Avoid inferring remote reachability or broader impact without additional vendor analysis.
Mitigation direction
Update to a vendor-supported kernel containing the referenced synchronization fix.
Confirm distribution backport status because package versions may differ from upstream kernel numbering.
Prioritize network-intensive or availability-critical hosts using the mlx5e driver.
Consult Linux or distribution guidance before considering operational workarounds.
Validation and detection
Inventory kernel versions and identify hosts using the mlx5e driver.
Map installed distribution packages to vendor advisories or fixed backports.
Review kernel logs for net_dim, mlx5e_napi_poll, NULL dereferences, or unexplained panics.
Verify the installed kernel incorporates one of the referenced stable commits or an equivalent backport.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-38440 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
4Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.