CVE-2025-21882 (GCVE-0-2025-21882)
Vulnerability from cvelistv5
Published
2025-03-27 14:57
Modified
2026-08-05 11:55
Summary
In the Linux kernel, the following vulnerability has been resolved: net/mlx5: Fix vport QoS cleanup on error When enabling vport QoS fails, the scheduling node was never freed, causing a leak. Add the missing free and reset the vport scheduling node pointer to NULL.
Impacted products
Vendor Product Version
Linux Linux Version: be034baba83e2a80a0b2c0f24c08547b6eedc79a
Version: be034baba83e2a80a0b2c0f24c08547b6eedc79a
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "fead368502bce0e10bea7c0d2895b2fa0c6c10aa",
              "status": "affected",
              "version": "be034baba83e2a80a0b2c0f24c08547b6eedc79a",
              "versionType": "git"
            },
            {
              "lessThan": "7f3528f7d2f98b70e19a6bb7b130fc82c079ac54",
              "status": "affected",
              "version": "be034baba83e2a80a0b2c0f24c08547b6eedc79a",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.13"
            },
            {
              "lessThan": "6.13",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.13.*",
              "status": "unaffected",
              "version": "6.13.6",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.14",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.13.6",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "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": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerable code is reached only through local configuration interfaces \u2014 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\u0027s 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\u0027s 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 \u2014 failed rate set, then subsequent rate operation or VF teardown \u2014 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-\u003eparent` makes `esw_qos_normalize_min_rate()` walk `parent-\u003echildren` out of a freed, attacker-groomable slab object and dereference `node-\u003eesw-\u003edev`, yielding a controlled-read primitive over kernel memory rather than a bounded leak.\nI:H - The freed parent is written through `list_del_init(\u0026vport_node-\u003eentry)` and via `node-\u003emax_rate`/`node-\u003ebw_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."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:55:05.817Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "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"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-21882",
    "datePublished": "2025-03-27T14:57:10.906Z",
    "dateReserved": "2024-12-29T08:45:45.782Z",
    "dateUpdated": "2026-08-05T11:55:05.817Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…