{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-38556",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-38556"
  ],
  "published": "2024-06-19T13:36:08Z",
  "summary": "net/mlx5: Add a timeout to acquire the command queue semaphore",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/mlx5: Add a timeout to acquire the command queue semaphore\n\nPrevent forced completion handling on an entry that has not yet been\nassigned an index, causing an out of bounds access on idx = -22.\nInstead of waiting indefinitely for the sem, blocking flow now waits for\nindex to be allocated or a sem acquisition timeout before beginning the\ntimer for FW completion.\n\nKernel log example:\nmlx5_core 0000:06:00.0: wait_func_handle_exec_timeout:1128:(pid 185911): cmd[-22]: CREATE_UCTX(0xa04) No done completion",
  "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.93",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-38556"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4baae687a20ef2b82fde12de3c04461e6f2521d6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f9caccdd42e999b74303c9b0643300073ed5d319"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2d0962d05c93de391ce85f6e764df895f47c8918"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/94024332a129c6e4275569d85c0c1bfb2ae2d71b"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/485d65e1357123a697c591a5aeb773994b247ad7"
    }
  ],
  "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 mlx5 firmware command interface is driven by local callers \u2014 RDMA uverbs/DEVX ioctls on /dev/infiniband/uverbs*, netdev/ethtool/devlink ops \u2014 not by received network packets. The reported trigger (CREATE_UCTX from a userspace pid) is a local ioctl path.\nAC:L - The attacker controls both sides: they flood the command interface to keep all max_reg_cmds slots occupied (a saturation mode mlx5 maintainers explicitly documented for unprivileged/high-rate command issuers) while issuing the victim blocking command that parks on the semaphore, and each resulting timeout permanently leaks a slot, making the exhausted-semaphore state self-reinforcing and eventually deterministic.\nPR:L - An unprivileged local user with access to /dev/infiniband/uverbs* (mode 0666 under stock rdma-core udev rules on RDMA-enabled hosts) can issue the exact CREATE_UCTX command from the report via ALLOC_UCONTEXT with MLX5_IB_ALLOC_UCTX_DEVX, with no capability check on that path.\nUI:N - Exploitation requires only the attacker's own syscalls/ioctls against the RDMA device; no action by any other user or administrator is needed.\nS:U - The use-after-free and its consequences are confined to the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The freed mlx5_cmd_work_ent is reused by the still-parked work handler, which reads ent->in/ent->out/ent->uout pointers out of reclaimed heap memory and copies FW output through them, giving an attacker who sprays the freed slot a read primitive into kernel memory.\nI:H - The parked handler writes ent->idx, ent->lay and ent->ts1 into freed memory, installs a dangling pointer in cmd->ent_arr[] that a later FW completion dereferences to call ent->callback(err, context) \u2014 a function pointer taken from sprayable freed memory \u2014 and programs DMA addresses read from freed memory into the NIC command descriptor before ringing the doorbell.\nA:H - The bug produces stuck commands, permanently leaked command-queue slots that eventually wedge the entire firmware command interface (rendering the NIC unconfigurable), plus a use-after-free that reliably causes oops/panic even when not fully exploited."
    }
  }
}
