{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-42285",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-42285"
  ],
  "published": "2024-08-17T09:11:20Z",
  "summary": "RDMA/iwcm: Fix a use-after-free related to destroying CM IDs",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/iwcm: Fix a use-after-free related to destroying CM IDs\n\niw_conn_req_handler() associates a new struct rdma_id_private (conn_id) with\nan existing struct iw_cm_id (cm_id) as follows:\n\n        conn_id->cm_id.iw = cm_id;\n        cm_id->context = conn_id;\n        cm_id->cm_handler = cma_iw_handler;\n\nrdma_destroy_id() frees both the cm_id and the struct rdma_id_private. Make\nsure that cm_work_handler() does not trigger a use-after-free by only\nfreeing of the struct rdma_id_private after all pending work has finished.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/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.103",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-42285"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d91d253c87fd1efece521ff2612078a35af673c6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7f25f296fc9bd0435be14e89bf657cd615a23574"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/94ee7ff99b87435ec63211f632918dc7f44dac79"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/557d035fe88d78dd51664f4dc0e1896c04c97cf6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/dc8074b8901caabb97c2d353abd6b4e7fa5a59a5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ff5bbbdee08287d75d72e65b72a2b76d9637892a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ee39384ee787e86e9db4efb843818ef0ea9cb8ae"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/aee2424246f9f1dadc33faa78990c1e2eb7826e4"
    }
  ],
  "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": 9.8,
      "cvss_v3_severity": "Critical",
      "scenario": "AV:N - The iWARP CM state machine exists exclusively to process connection-management events (CONNECT_REQUEST/REPLY, ESTABLISHED, DISCONNECT, CLOSE) originated by remote peers over MPA/TCP, and the freed-object dereference occurs inside `cm_work_handler()`/`cma_iw_handler()` while handling such a remote event. Network-facing RDMA targets over iWARP (nvmet-rdma, NFS/RDMA svcrdma, iSER, SMB Direct, on cxgb4/irdma/qedr or software siw) drive both the event delivery and the `rdma_destroy_id()` teardown from remote peer actions.\nAC:L - The attacker controls both sides of the race: the connect/abort lifecycle of their own connection generates the queued CM events, and forcing a connection rejection or resetting the TCP connection drives the concurrent `rdma_destroy_id()`. The sequence can be repeated in a tight loop across many concurrent connections until the window is hit, with no condition outside attacker influence.\nPR:N - The RDMA-CM/iWARP handshake and the entire connect-reject-disconnect cycle complete before any upper-layer authentication (NVMe-oF Connect/in-band auth, RPCSEC, SMB session setup), so an unauthenticated peer that can reach the target port suffices. The local variant is even weaker-gated: rdma_ucm's `/dev/infiniband/rdma_cm` handlers contain no capability checks at all.\nUI:N - Exploitation is entirely driven by the attacker's own connection attempts and teardowns against an already-listening RDMA service. No action by any local user or administrator is required.\nS:U - The use-after-free corrupts kernel heap memory and hijacks kernel control flow within the same security authority as the vulnerable component. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - After the free, `cma_iw_handler()` reads `id_priv->state`, `id_priv->cm_id`, and other fields from the reallocated slab object, and the resulting control-flow hijack via the stale `event_handler` pointer can be leveraged for arbitrary kernel memory disclosure. Per kernel guidance a use-after-free is scored High for confidentiality.\nI:H - `cma_cm_event_handler()` performs an indirect call through `id_priv->id.event_handler` read from the freed object, and `mutex_lock(&id_priv->handler_mutex)` writes into it \u2014 together giving heap-spray-based arbitrary write and code-execution potential. This is a full control-flow hijack primitive, not a bounded corruption.\nA:H - Even without successful grooming, dereferencing the freed `rdma_id_private` (mutex operations and an indirect call on garbage) reliably oopses or panics the kernel, as observed by KASAN slab-use-after-free reports during blktests. The trigger is repeatable, so a remote attacker can crash the target at will."
    }
  }
}
