{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2023-54135",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2023-54135"
  ],
  "published": "2025-12-24T13:11:50Z",
  "summary": "maple_tree: fix potential out-of-bounds access in mas_wr_end_piv()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmaple_tree: fix potential out-of-bounds access in mas_wr_end_piv()\n\nCheck the write offset end bounds before using it as the offset into the\npivot array.  This avoids a possible out-of-bounds access on the pivot\narray if the write extends to the last slot in the node, in which case the\nnode maximum should be used as the end pivot.\n\nakpm: this doesn't affect any current callers, but new users of mapletree\nmay encounter this problem if backported into earlier kernels, so let's\nfix it in -stable kernels in case of this.",
  "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.21-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v6",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7l",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v8",
            "binary_version": "1:6.1.21-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.21-1+rpt1": {
            "linux_commit": "0afb5e98488aed7017b9bf321b575d0177feb7ed",
            "upstream_version": "6.1.21",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.37"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2023-54135"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4e2ad53ababeaac44d71162650984abfe783960c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/dc4751bd4aba01ccfc02f91adfeee0ba4cda405c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f5fcf6555a2a4f32947d17b92b173837cc652891"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/cd00dd2585c4158e81fdfac0bbcc0446afbad26d"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:24:39Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The maple tree write path is reached only through local syscalls \u2014 `mmap()`, `munmap()`, `mprotect()`, `mremap()`, `brk()` via `vma_iter_store*()`/`vma_iter_clear*()` \u2192 `mas_store_gfp()`/`mas_store_prealloc()` \u2192 `mas_wr_end_piv()`. The other in-tree users (btrfs send LRU cache, regcache-maple) are likewise local/driver-internal, with no remote packet-processing path.\nAC:L - The trigger is a completely full 16-slot leaf node plus a store whose range starts in an earlier slot and ends inside the final slot \u2014 a tree shape an unprivileged attacker deterministically constructs by creating thousands of non-mergeable VMAs and then unmapping a spanning range. No race and no memory layout outside the attacker's influence is involved.\nPR:L - Any unprivileged local process reaches the code with plain `mmap()`/`munmap()` calls on its own address space; there is no capability check, LSM gate, or namespace requirement anywhere along `do_vmi_align_munmap()` \u2192 `vma_iter_clear_gfp()` \u2192 `mas_wr_store_entry()`.\nUI:N - The attacking process triggers the faulty write path entirely through its own address-space syscalls; no victim action, mount, or file open is required.\nS:U - The out-of-bounds pivot read and the resulting maple-tree corruption are confined to the kernel's own memory-management structures, which are the same security authority as the compromised kernel. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - The array overrun reads a live kernel pointer (`slot[0]`, a `struct vm_area_struct *`) and turns it into a range boundary, and the resulting `mas->last`/`new_end` corruption leaves stale VMA pointers and bogus ranges in the VMA tree \u2014 memory corruption that can be leveraged into an arbitrary-read primitive, and whose pivot values are indirectly observable through mmap gap placement.\nI:H - A bogus `end_piv` propagates into `mas_wr_extend_null()`, which can set `mas->last` to a kernel heap pointer value beyond the node's `mas->max`, and into `mas_wr_node_store()`'s `new_end` computation, causing the store to overwrite the wrong ranges and leave stale slots \u2014 VMA-tree corruption exploitable for use-after-free and arbitrary-write primitives.\nA:H - Writing a range past the node maximum and leaving stale slots violates maple-tree invariants, producing `MT_BUG_ON`/`VM_BUG_ON` hits, oopses, or use-after-free on `vm_area_struct` during any subsequent tree walk or address-space teardown, crashing the kernel."
    }
  }
}
