{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-35813",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-35813"
  ],
  "published": "2024-05-17T13:23:58Z",
  "summary": "mmc: core: Avoid negative index with array access",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmmc: core: Avoid negative index with array access\n\nCommit 4d0c8d0aef63 (\"mmc: core: Use mrq.sbc in close-ended ffu\") assigns\nprev_idata = idatas[i - 1], but doesn't check that the iterator i is\ngreater than zero. Let's fix this by adding a check.",
  "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.6.20-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-2712",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v6",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v7",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v7l",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v8",
            "binary_version": "1:6.6.20-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.6.20-1+rpt1": {
            "linux_commit": "6f16847710cc0502450788b9f12f0a14d3429668",
            "upstream_version": "6.6.20",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.6.24"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-35813"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b9a7339ae403035ffe7fc37cb034b36947910f68"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2b539c88940e22494da80a93ee1c5a28bbad10f6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/81b8645feca08a54c7c4bf36e7b176f4983b2f28"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ad9cc5e9e53ab94aa0c7ac65d43be7eb208dcb55"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4466677dcabe2d70de6aa3d4bd4a4fafa94a71f2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/064db53f9023a2d5877a2d12de6bc27995f6ca56"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7d0e8a6147550aa058fa6ade8583ad252aa61304"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/cf55a7acd1ed38afe43bba1c8a0935b51d1dc014"
    }
  ],
  "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 bug is reached only via the MMC_IOC_CMD / MMC_IOC_MULTI_CMD ioctls on the local /dev/mmcblkN block device or the /dev/mmcblkNrpmb character device. There is no remote or adjacent-network path into drivers/mmc/core/block.c.\nAC:L - Triggering requires the uninitialized `flags` field (kmalloc'd throughout the affected range) to have MMC_BLK_IOC_SBC set on the first command, which the attacker controls by grooming the kmalloc-96/128 slab before the ioctl, and which can be retried in a tight loop at no cost. The subsequent `idatas[-1]` neighbor (an adjacent kmalloc-8 object or a live stack slot) is likewise attacker-influenceable via standard heap/stack spraying.\nPR:L - The RPMB character-device entry point (mmc_rpmb_ioctl \u2192 mmc_blk_ioctl_cmd/mmc_blk_ioctl_multi_cmd) performs no capable() check whatsoever \u2014 only DAC permissions on /dev/mmcblkNrpmb gate it \u2014 and on Android and embedded platforms that node is routinely opened by non-root system daemons, so an unprivileged-but-authorized local process suffices.\nUI:N - The attacker issues the ioctl directly from their own process; no victim action, mount, or file open by another user is needed.\nS:U - The out-of-bounds access and the resulting corruption are entirely within the kernel's own security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The negative index performs an out-of-bounds read of a pointer, and the resulting `prev_idata->ic.arg` dereference reads attacker-chosen kernel memory that is then emitted as the CMD23 argument; more broadly the memory corruption is leverageable for kernel information disclosure.\nI:H - `memcpy(&prev_idata->ic.response, sbc.resp, sizeof(sbc.resp))` performs a 16-byte write through the out-of-bounds-derived pointer, giving a write primitive at a heap-groomable address (or over live kernel pointers on the stack) that is exploitable for privilege escalation.\nA:H - Dereferencing the wild `idatas[-1]` pointer \u2014 read at `prev_idata->ic.arg` and write at `prev_idata->ic.response` \u2014 reliably produces a kernel oops/panic in the common case where the neighboring memory is not a valid object."
    }
  }
}
