CVE-2023-54238 (GCVE-0-2023-54238)
Vulnerability from cvelistv5
Published
2025-12-30 12:11
Modified
2026-08-05 09:18
Summary
In the Linux kernel, the following vulnerability has been resolved: mlx5: fix skb leak while fifo resync and push During ptp resync operation SKBs were poped from the fifo but were never freed neither by napi_consume nor by dev_kfree_skb_any. Add call to napi_consume_skb to properly free SKBs. Another leak was happening because mlx5e_skb_fifo_has_room() had an error in the check. Comparing free running counters works well unless C promotes the types to something wider than the counter. In this case counters are u16 but the result of the substraction is promouted to int and it causes wrong result (negative value) of the check when producer have already overlapped but consumer haven't yet. Explicit cast to u16 fixes the issue.
Impacted products
Vendor Product Version
Linux Linux Version: 58a518948f60153e8f6cb8361d2712aa3a1af94a
Version: 58a518948f60153e8f6cb8361d2712aa3a1af94a
Version: 58a518948f60153e8f6cb8361d2712aa3a1af94a
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/en/ptp.c",
            "drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "234cffda95e1049f58e8ec136ef105c633f0ed19",
              "status": "affected",
              "version": "58a518948f60153e8f6cb8361d2712aa3a1af94a",
              "versionType": "git"
            },
            {
              "lessThan": "68504c66d08c70fb92799722e25a932d311d74fd",
              "status": "affected",
              "version": "58a518948f60153e8f6cb8361d2712aa3a1af94a",
              "versionType": "git"
            },
            {
              "lessThan": "e435941b1da1a0be4ff8a7ae425774c76a5ac514",
              "status": "affected",
              "version": "58a518948f60153e8f6cb8361d2712aa3a1af94a",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c",
            "drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.0"
            },
            {
              "lessThan": "6.0",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.18",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.2.*",
              "status": "unaffected",
              "version": "6.2.5",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.3",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.18",
                  "versionStartIncluding": "6.0",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.2.5",
                  "versionStartIncluding": "6.0",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.3",
                  "versionStartIncluding": "6.0",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmlx5: fix skb leak while fifo resync and push\n\nDuring ptp resync operation SKBs were poped from the fifo but were never\nfreed neither by napi_consume nor by dev_kfree_skb_any. Add call to\nnapi_consume_skb to properly free SKBs.\n\nAnother leak was happening because mlx5e_skb_fifo_has_room() had an error\nin the check. Comparing free running counters works well unless C promotes\nthe types to something wider than the counter. In this case counters are\nu16 but the result of the substraction is promouted to int and it causes\nwrong result (negative value) of the check when producer have already\noverlapped but consumer haven\u0027t yet. Explicit cast to u16 fixes the issue."
        }
      ],
      "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 defect is in the mlx5 PTP transmit/completion path, reached by locally originated packets \u2014 an unprivileged process opening a UDP socket, enabling SO_TIMESTAMPING with SOF_TIMESTAMPING_TX_HARDWARE, and sending to port 319 (or ethertype 0x88F7). A remote peer cannot set SKBTX_HW_TSTAMP on the host\u0027s outbound skbs, so the reliable trigger is a local syscall path, not received network data.\nAC:L - Both preconditions are entirely under the attacker\u0027s control: the u16 producer counter is advanced by the attacker\u0027s own packets, so wrapping into the broken-comparison window is deterministic after ~65536 sends, and outrunning the slower port-timestamp CQ is achieved by simply bursting traffic. No race the attacker cannot drive, no unpredictable memory layout, and the enabling tx_port_ts priv-flag is a routine runtime setting in PTP-timestamping deployments rather than a rare build option.\nPR:L - Neither setsockopt(SO_TIMESTAMPING) with SOF_TIMESTAMPING_TX_HARDWARE nor sending UDP to port 319 requires any capability, and mlx5e_use_ptpsq() checks only the skb tx_flags and packet classification \u2014 no hwtstamp or privilege gate. Any unprivileged local account can therefore drive skbs onto the PTP SQ and overflow the fifo.\nUI:N - The attacker\u0027s own packet transmission drives the fifo overflow and the corrupted TS-CQE consumption entirely; no action by any other user or administrator is needed once the interface is in its normal PTP configuration.\nS:U - The corruption is confined to kernel heap objects (sk_buff slab entries and the driver\u0027s skb fifo) within the same kernel security authority. There is no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - Duplicate pops make the TS-CQ path dereference already-freed sk_buffs \u2014 mlx5e_skb_cb_get_hwts() reads freed slab memory and skb_tstamp_tx() clones the freed (and possibly reallocated) skb and delivers it to a socket\u0027s error queue, exposing kernel heap contents to userspace. The premature-free primitive is also the classic basis for a controlled arbitrary-read via heap spraying.\nI:H - The same duplicate consumption causes skb refcount underflow and double free of a kmem_cache object, corrupting the slab freelist, while mlx5e_skb_cb_hwtstamp_handler() writes hwtstamp values and memsets into the freed object\u0027s cb field. That combination of double-free plus write-into-freed-memory is a heap corruption primitive usable for control-flow hijack.\nA:H - The overflow reliably produces kernel oopses in softirq/NAPI context \u2014 NULL dereference on never-written kvzalloc\u0027d fifo slots during the resync loop, WARN_ON_ONCE in mlx5e_skb_fifo_pop() (fatal under panic_on_warn), and double-free BUGs \u2014 taking down the machine. Independently, the unfreed skbs in the resync path leak memory without bound until OOM."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T09:18:19.166Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/234cffda95e1049f58e8ec136ef105c633f0ed19"
        },
        {
          "url": "https://git.kernel.org/stable/c/68504c66d08c70fb92799722e25a932d311d74fd"
        },
        {
          "url": "https://git.kernel.org/stable/c/e435941b1da1a0be4ff8a7ae425774c76a5ac514"
        }
      ],
      "title": "mlx5: fix skb leak while fifo resync and push",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-54238",
    "datePublished": "2025-12-30T12:11:27.702Z",
    "dateReserved": "2025-12-30T12:06:44.508Z",
    "dateUpdated": "2026-08-05T09:18:19.166Z",
    "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…