{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-54458",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-54458"
  ],
  "published": "2025-02-27T02:18:18Z",
  "summary": "scsi: ufs: bsg: Set bsg_queue to NULL after removal",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: ufs: bsg: Set bsg_queue to NULL after removal\n\nCurrently, this does not cause any issues, but I believe it is necessary to\nset bsg_queue to NULL after removing it to prevent potential use-after-free\n(UAF) access.",
  "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.129",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-54458"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/bb4783c670180b922267222408e1c48d22dfbb46"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/22018622e1e9e371198dbd983af946a844d5924c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/5e7b6e44468c3242c21c2a8656d009fb3eb50a73"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/5f782d4741bf558def60df192b858b0efc6a5f0a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/88a01e9c9ad40c075756ba93b47984461d4ff15d"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9193bdc170cc23fe98aca71d1a63c0bf6e1e853b"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/1e95c798d8a7f70965f0f88d4657b682ff0ec75f"
    }
  ],
  "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 affected code is entirely in the UFS host controller driver lifecycle path (`ufshcd_remove()` \u2192 `ufs_bsg_remove()`), reached through local actions such as sysfs driver unbind, module unload, or device teardown, and the associated `/dev/bsg/ufs-bsg0` endpoint is a local character device. No network or adjacent-network input reaches this code.\nAC:L - The stale `hba->bsg_queue` pointer is created unconditionally on every teardown \u2014 there is no error path to hit, no race to win, and no memory-layout precondition the attacker cannot influence; reclaiming the freed `request_queue`/`bsg_set` slab is a standard heap spray the attacker drives, and an open bsg fd lets the attacker choose when the object is actually freed.\nPR:L - Consistent with how this database scores driver-teardown and \"set pointer to NULL after free\" UAFs, a low-privileged local account able to drive device/driver lifecycle events is sufficient; no authentication beyond ordinary local access to the UFS host's lifecycle and bsg endpoint is assumed.\nUI:N - The teardown sequence is performed by the attacker itself (unbind/unload) or happens autonomously during device removal; no victim must mount a filesystem, open a file, or take any other action.\nS:U - The freed `struct request_queue` and `struct bsg_set` and all consequences of dereferencing them stay within the kernel's own security authority, with no crossing into a hypervisor, IOMMU, or other separate scope.\nC:H - Re-entry through the dangling pointer reads `q->tag_set` from freed memory and follows `bset->bd` into `bd->queue->disk` and `cdev_device_del()`, so reclaimed heap contents are interpreted as kernel structures, giving attacker-directed pointer dereferences and disclosure of arbitrary kernel memory.\nI:H - The freed `struct bsg_set` contains the `job_fn` and `timeout_fn` function pointers and the `bd` device pointer, and the reuse path performs `put_device()` (refcount decrement plus release-callback indirect call) and a second `kfree(bset)`, so heap spraying the reclaimed allocation yields write and control-flow-hijack primitives.\nA:H - Use-after-free and double-free on the request queue and bsg set reliably produce slab corruption, a kernel oops, or a panic, which on a UFS-backed Android phone or embedded system means loss of the primary storage controller and of the machine."
    }
  }
}
