{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-21882",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-12-29T08:45:45.782Z",
        "datePublished": "2025-03-27T14:57:10.906Z",
        "dateUpdated": "2026-08-05T11:55:05.817Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T11:55:05.817Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/mlx5: Fix vport QoS cleanup on error\n\nWhen enabling vport QoS fails, the scheduling node was never freed,\ncausing a leak.\n\nAdd the missing free and reset the vport scheduling node pointer to\nNULL."
                }
            ],
            "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 vulnerable code is reached only through local configuration interfaces — devlink rate netlink, rtnetlink `ip link set ... vf N rate`, or tc matchall/police offload on a VF representor. No remote peer data reaches this path.\nAC:L - The attacker drives the failing branch himself by exhausting the E-Switch scheduling-element pool through repeated rate-object creation across VFs/SFs (and on FW not advertising the VPORT element type in the E-Switch hierarchy it fails deterministically on the first try), then triggers the dangling-pointer use with a follow-up rate operation or VF teardown. No condition lies outside the attacker's influence.\nPR:L - The tc and `ndo_set_vf_rate` paths gate only on `netlink_net_capable(skb, CAP_NET_ADMIN)`, i.e. CAP_NET_ADMIN in the network namespace's owning user namespace, so an unprivileged user inside a userns-owned container netns holding a delegated mlx5 representor/netdev can reach `mlx5_esw_qos_vport_enable()`. This is delegated, non-root-equivalent privilege.\nUI:N - The whole sequence — failed rate set, then subsequent rate operation or VF teardown — is performed by the attacker alone. No victim action is needed.\nS:U - The corruption is confined to mlx5 eswitch QoS objects in kernel heap memory within the same security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The stale `sched_node->parent` makes `esw_qos_normalize_min_rate()` walk `parent->children` out of a freed, attacker-groomable slab object and dereference `node->esw->dev`, yielding a controlled-read primitive over kernel memory rather than a bounded leak.\nI:H - The freed parent is written through `list_del_init(&vport_node->entry)` and via `node->max_rate`/`node->bw_share` stores reached through pointers read from freed memory, giving a UAF write primitive; the `esw_qos_put()` refcount imbalance additionally frees a live node0 out from under other vports, and the stale `ix == 0` causes FW MODIFY/DESTROY on unrelated scheduling elements.\nA:H - VF teardown unconditionally walks the dangling node, producing list-debug corruption, `refcount_t` underflow WARNs and oops/panic from the use-after-free; destroying scheduling element 0 can additionally tear down the E-Switch root TSAR and disrupt traffic for every port on the adapter."
                        }
                    ]
                }
            ],
            "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/esw/qos.c"
                    ],
                    "versions": [
                        {
                            "version": "be034baba83e2a80a0b2c0f24c08547b6eedc79a",
                            "lessThan": "fead368502bce0e10bea7c0d2895b2fa0c6c10aa",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "be034baba83e2a80a0b2c0f24c08547b6eedc79a",
                            "lessThan": "7f3528f7d2f98b70e19a6bb7b130fc82c079ac54",
                            "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/esw/qos.c"
                    ],
                    "versions": [
                        {
                            "version": "6.13",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.13",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.13.6",
                            "lessThanOrEqual": "6.13.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.14",
                            "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.13",
                                    "versionEndExcluding": "6.13.6"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.13",
                                    "versionEndExcluding": "6.14"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/fead368502bce0e10bea7c0d2895b2fa0c6c10aa"
                },
                {
                    "url": "https://git.kernel.org/stable/c/7f3528f7d2f98b70e19a6bb7b130fc82c079ac54"
                }
            ],
            "title": "net/mlx5: Fix vport QoS cleanup on error",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}