{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-43913",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-43913"
  ],
  "published": "2024-08-26T10:22:19Z",
  "summary": "nvme: apple: fix device reference counting",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnvme: apple: fix device reference counting\n\nDrivers must call nvme_uninit_ctrl after a successful nvme_init_ctrl.\nSplit the allocation side out to make the error handling boundary easier\nto navigate. The apple driver had been doing this wrong, leaking the\ncontroller device memory on a tagset failure.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:H/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": null,
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-43913"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f7d9a18572fcd7130459b7691bd19ee2a2e951ad"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d59c4d0eb6adc24c2201f153ccb7fd0a335b0d3d"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b9ecbfa45516182cd062fecd286db7907ba84210"
    }
  ],
  "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.0,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The affected code is the Apple ANS2 SoC-internal NVMe platform driver; the vulnerable state is created during local device probe and reached afterwards through ordinary local syscalls (reading `/sys/class/nvme/nvmeN/*`, opening `/dev/nvmeN`). No network, adjacent-network, or physical-access path exists \u2014 the controller is on-die, so physical presence buys nothing.\nAC:H - The only branch reaching the buggy `put_dev` label after `nvme_init_ctrl()` succeeds is a `blk_mq_alloc_queue()` failure, i.e. a `GFP_KERNEL` allocation failure inside device probe \u2014 small GFP_KERNEL allocations do not fail on demand (they retry and invoke the OOM killer), and probe normally runs only at boot. The attacker cannot influence whether this precondition occurs.\nPR:L - Once the probe has failed and left the controller device registered over freed devm memory, the dangling object is reached with no privileges beyond an unprivileged local account: `/sys/class/nvme/nvmeN/` is world-traversable and `model`, `serial`, `firmware_rev`, `state`, `transport`, `subsysnqn`, `address`, `cntlid`, `queue_count` are all `S_IRUGO` with no capability check in their show handlers.\nUI:N - No victim action is required \u2014 the failing probe occurs on its own during boot under memory pressure, and the attacker simply reads the leaked sysfs attributes or opens the leaked device node.\nS:U - The corruption is confined to kernel memory within the same security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - This is a use-after-free read of the `nvme_ctrl` embedded in the devres-freed `anv` block \u2014 `model_show`/`serial_show`/`firmware_rev_show` follow `ctrl->subsys` out of freed memory and `sysfs_emit()` the bytes straight to userspace, disclosing whatever kernel data has reclaimed that slab object.\nI:H - The still-registered device leaves function pointers (`ctrl->ops->get_address`, `ctrl->device->release`, the cdev's `f_op`) inside a freed slab block the attacker can reclaim and groom by spraying same-size allocations, and `nvme_sysfs_show_address()` performs an indirect call through one of them \u2014 a control-flow hijack primitive, with `reset_controller`/`delete_controller`/`passthru_err_log_enabled` stores writing into the freed object as well.\nA:H - Dereferencing the freed controller (`ctrl->subsys->model`, `ctrl->ops->get_address()`) oopses the kernel, and because the stale `/dev/nvmeN` and sysfs nodes persist for the lifetime of the boot the crash can be re-triggered at will by any local user; the unreleased ida instance, discard page, and srcu struct also leak on every occurrence."
    }
  }
}
