{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-26872",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-26872"
  ],
  "published": "2024-04-17T10:29:01Z",
  "summary": "RDMA/srpt: Do not register event handler until srpt device is fully setup",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/srpt: Do not register event handler until srpt device is fully setup\n\nUpon rare occasions, KASAN reports a use-after-free Write\nin srpt_refresh_port().\n\nThis seems to be because an event handler is registered before the\nsrpt device is fully setup and a race condition upon error may leave a\npartially setup event handler in place.\n\nInstead, only register the event handler after srpt device initialization\nis complete.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.83",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-26872"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/bdd895e0190c464f54f84579e7535d80276f0fc5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/6413e78086caf7bf15639923740da0d91fdfd090"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e362d007294955a4fb929e1c8978154a64efdcb6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/85570b91e4820a0db9d9432098778cafafa7d217"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7104a00fa37ae898a827381f1161fa3286c8b346"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ec77fa12da41260c6bf9e060b89234b980c5130f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c21a8870c98611e8f892511825c9607f1e2cd456"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The race is driven through local interfaces \u2014 RDMA netlink `RDMA_NLDEV_CMD_NEWLINK` to register an IB device (triggering `srpt_add_one`) and netdev up/down to dispatch the async IB port events. No remote packet processing is involved in reaching the vulnerable window.\nAC:L - The attacker controls both sides of the race: repeated `rdma link add`/`del` of soft-RoCE devices re-enters `srpt_add_one()` at will, while concurrent netdev link flaps generate `IB_EVENT_PORT_ACTIVE`/`IB_EVENT_PORT_ERR` inside the unprotected window, and keeping the netdev down makes `rdma_query_gid()` fail to force the `err_port` free path.\nPR:L - `nldev_newlink` is gated only by `netlink_capable(skb, CAP_NET_ADMIN)`, which resolves against the netns-owning user namespace, so an unprivileged user satisfies it via `unshare -Urn`; RDMA_NL_NLDEV is explicitly allowed in non-init net namespaces and `rxe_newlink()` adds no further restriction.\nUI:N - The attacker triggers device registration and the async IB events entirely from their own processes; no action by any other user or administrator is required.\nS:U - The corruption is confined to kernel slab memory within the same security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The use-after-free on the freed `srpt_device`/`srpt_port` allocation lets the attacker reclaim the slab object with a chosen structure, turning the stale `sport` reference into a means of reading and disclosing arbitrary kernel memory.\nI:H - `srpt_refresh_port()` writes into the freed object \u2014 `sm_lid`, `lid`, a 16-byte `gid`, and two `snprintf()`-formatted strings \u2014 giving a multi-byte write into attacker-sprayed heap memory that can corrupt adjacent kernel structures and be leveraged for control-flow hijacking.\nA:H - Both failure modes crash the kernel: `schedule_work()` on a zeroed `work_struct` makes the kworker call a NULL `work->func`, and the use-after-free write reliably produces oopses/panics."
    }
  }
}
