{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-38440",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T04:51:24.016Z",
        "datePublished": "2025-07-25T15:27:19.447Z",
        "dateUpdated": "2026-08-05T12:01:56.083Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:01:56.083Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/mlx5e: Fix race between DIM disable and net_dim()\n\nThere's a race between disabling DIM and NAPI callbacks using the dim\npointer on the RQ or SQ.\n\nIf NAPI checks the DIM state bit and sees it still set, it assumes\n`rq->dim` or `sq->dim` is valid. But if DIM gets disabled right after\nthat check, the pointer might already be set to NULL, leading to a NULL\npointer dereference in net_dim().\n\nFix this by calling `synchronize_net()` before freeing the DIM context.\nThis ensures all in-progress NAPI callbacks are finished before the\npointer is cleared.\n\nKernel log:\n\nBUG: kernel NULL pointer dereference, address: 0000000000000000\n...\nRIP: 0010:net_dim+0x23/0x190\n...\nCall Trace:\n <TASK>\n ? __die+0x20/0x60\n ? page_fault_oops+0x150/0x3e0\n ? common_interrupt+0xf/0xa0\n ? sysvec_call_function_single+0xb/0x90\n ? exc_page_fault+0x74/0x130\n ? asm_exc_page_fault+0x22/0x30\n ? net_dim+0x23/0x190\n ? mlx5e_poll_ico_cq+0x41/0x6f0 [mlx5_core]\n ? sysvec_apic_timer_interrupt+0xb/0x90\n mlx5e_handle_rx_dim+0x92/0xd0 [mlx5_core]\n mlx5e_napi_poll+0x2cd/0xac0 [mlx5_core]\n ? mlx5e_poll_ico_cq+0xe5/0x6f0 [mlx5_core]\n busy_poll_stop+0xa2/0x200\n ? mlx5e_napi_poll+0x1d9/0xac0 [mlx5_core]\n ? mlx5e_trigger_irq+0x130/0x130 [mlx5_core]\n __napi_busy_loop+0x345/0x3b0\n ? sysvec_call_function_single+0xb/0x90\n ? asm_sysvec_call_function_single+0x16/0x20\n ? sysvec_apic_timer_interrupt+0xb/0x90\n ? pcpu_free_area+0x1e4/0x2e0\n napi_busy_loop+0x11/0x20\n xsk_recvmsg+0x10c/0x130\n sock_recvmsg+0x44/0x70\n __sys_recvfrom+0xbc/0x130\n ? __schedule+0x398/0x890\n __x64_sys_recvfrom+0x20/0x30\n do_syscall_64+0x4c/0x100\n entry_SYSCALL_64_after_hwframe+0x4b/0x53\n...\n---[ end trace 0000000000000000 ]---\n...\n---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---"
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7.8,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The race is initiated through a local interface — the ethtool coalescing setter (SIOCETHTOOL/ETHTOOL_SCOALESCE or ethtool-netlink COALESCE_SET) toggling adaptive-rx/tx on an mlx5e netdev. Network traffic only drives the NAPI side; the triggering action requires local access to the device's netns.\nAC:L - The attacker controls both sides of the race — repeatedly enabling/disabling DIM while simultaneously keeping NAPI running via traffic or busy-poll recvmsg() — and can retry indefinitely at no cost. No condition beyond the attacker's influence is required.\nPR:L - The path requires CAP_NET_ADMIN only over the network namespace owning the netdev (`ns_capable(net->user_ns, CAP_NET_ADMIN)`), which an unprivileged user obtains in a user namespace (unshare -Urn) that holds an mlx5 netdev such as an SR-IOV VF assigned to a container.\nUI:N - The attacker performs both the ethtool toggle and the traffic generation; no action by any other user or administrator is needed.\nS:U - The corruption and crash are confined to the kernel of the affected host, with no crossing into a different security authority such as a hypervisor or IOMMU boundary.\nC:H - The freed `struct dim` can be dereferenced by in-flight NAPI after `kvfree()`, and a use-after-free on a heap-sprayable slab object lets an attacker overlap it with attacker-chosen data and leverage the resulting corruption for disclosure of kernel memory.\nI:H - `net_dim()` writes into the freed object (`dim->state`, `dim->start_sample`) and calls `schedule_work(&dim->work)` on a freed `work_struct`, giving write and list-manipulation primitives against reclaimed memory that are exploitable for control-flow hijacking.\nA:H - The demonstrated result is a NULL pointer dereference inside `net_dim()` executing in interrupt context, producing \"Fatal exception in interrupt\" and a full kernel panic that the attacker can trigger repeatedly."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/net/ethernet/mellanox/mlx5/core/en_dim.c"
                    ],
                    "versions": [
                        {
                            "version": "445a25f6e1a2f6a132b06af6ede4f3c9b5f9af68",
                            "lessThan": "7581afc051542e11ccf3ade68acd01b7fb1a3cde",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "445a25f6e1a2f6a132b06af6ede4f3c9b5f9af68",
                            "lessThan": "2bc6fb90486e42dd80e660ef7a40c02b2516c6d6",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "445a25f6e1a2f6a132b06af6ede4f3c9b5f9af68",
                            "lessThan": "eb41a264a3a576dc040ee37c3d9d6b7e2d9be968",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/net/ethernet/mellanox/mlx5/core/en_dim.c"
                    ],
                    "versions": [
                        {
                            "version": "6.10",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.10",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.39",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15.7",
                            "lessThanOrEqual": "6.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.16",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.10",
                                    "versionEndExcluding": "6.12.39"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.10",
                                    "versionEndExcluding": "6.15.7"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.10",
                                    "versionEndExcluding": "6.16"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/7581afc051542e11ccf3ade68acd01b7fb1a3cde"
                },
                {
                    "url": "https://git.kernel.org/stable/c/2bc6fb90486e42dd80e660ef7a40c02b2516c6d6"
                },
                {
                    "url": "https://git.kernel.org/stable/c/eb41a264a3a576dc040ee37c3d9d6b7e2d9be968"
                }
            ],
            "title": "net/mlx5e: Fix race between DIM disable and net_dim()",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}