{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-35787",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-35787"
  ],
  "published": "2024-05-17T12:25:21Z",
  "summary": "md/md-bitmap: fix incorrect usage for sb_index",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmd/md-bitmap: fix incorrect usage for sb_index\n\nCommit d7038f951828 (\"md-bitmap: don't use ->index for pages backing the\nbitmap file\") removed page->index from bitmap code, but left wrong code\nlogic for clustered-md. current code never set slot offset for cluster\nnodes, will sometimes cause crash in clustered env.\n\nCall trace (partly):\n md_bitmap_file_set_bit+0x110/0x1d8 [md_mod]\n md_bitmap_startwrite+0x13c/0x240 [md_mod]\n raid1_make_request+0x6b0/0x1c08 [raid1]\n md_handle_request+0x1dc/0x368 [md_mod]\n md_submit_bio+0x80/0xf8 [md_mod]\n __submit_bio+0x178/0x300\n submit_bio_noacct_nocheck+0x11c/0x338\n submit_bio_noacct+0x134/0x614\n submit_bio+0x28/0xdc\n submit_bh_wbc+0x130/0x1cc\n submit_bh+0x1c/0x28",
  "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-35787"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/736ad6c577a367834118f57417038d45bb5e0a31"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/55e55eb65fd5e09faf5a0e49ffcdd37905aaf4da"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/5a95815b17428ce2f56ec18da5e0d1b2a1a15240"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ecbd8ebb51bf7e4939d83b9e6022a55cac44ef06"
    }
  ],
  "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 vulnerable code is reached through the local block-I/O path (`submit_bio` \u2192 `md_submit_bio` \u2192 `raid1_make_request` \u2192 `md_bitmap_startwrite`) on a clustered md array; no network protocol handler processes attacker data here.\nAC:L - On any cluster node whose slot is non-zero (every node but DLM slot 1), the index computation is unconditionally negative, so the out-of-bounds `set_bit()` fires on the first write to each bitmap chunk \u2014 deterministic, with no race and no memory-layout precondition the attacker cannot influence.\nPR:L - Clustered md arrays are deployed under shared filesystems (GFS2/OCFS2), so any unprivileged local user with write access to a file generates the bios that reach `md_bitmap_startwrite`; there is no capability check on the path from `write()` to `md_bitmap_file_set_bit()`.\nUI:N - The attacker simply issues writes to the array; no action by any other user or administrator is needed at exploitation time.\nS:U - The corrupted memory is kernel slab memory belonging to the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `md_bitmap_file_clear_bit()` performs an out-of-bounds `test_page_attr()` read before the `filemap_attr` allocation, and the resulting slab corruption is a general heap-corruption primitive that can be leveraged to disclose kernel memory.\nI:H - `set_bit()` with a negative bit number writes into slab memory preceding the `filemap_attr` buffer at an offset the attacker steers by choosing the written file offset, giving a controlled OOB bit-set usable for heap corruption; additionally the write-intent bitmap is never marked dirty, so the on-disk bitmap goes stale and RAID resync produces inconsistent data.\nA:H - The commit states the bug \"will sometimes cause crash in clustered env\" and includes an oops trace through `md_bitmap_file_set_bit`; slab corruption from repeated OOB writes readily panics the node."
    }
  }
}
