{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-35905",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-35905"
  ],
  "published": "2024-05-19T08:35:32Z",
  "summary": "bpf: Protect against int overflow for stack access size",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Protect against int overflow for stack access size\n\nThis patch re-introduces protection against the size of access to stack\nmemory being negative; the access size can appear negative as a result\nof overflowing its signed int representation. This should not actually\nhappen, as there are other protections along the way, but we should\nprotect against it anyway. One code path was missing such protections\n(fixed in the previous patch in the series), causing out-of-bounds array\naccesses in check_stack_range_initialized(). This patch causes the\nverification of a program with such a non-sensical access size to fail.\n\nThis check used to exist in a more indirect way, but was inadvertendly\nremoved in a833a17aeac7.",
  "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.26"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-35905"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9970e059af471478455f9534e8c3db82f8c5496d"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/37dc1718dc0c4392dbfcb9adec22a776e745dd69"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/98cdac206b112bec63852e94802791e316acc2c1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3f0784b2f1eb9147973d8c43ba085c5fdf44ff69"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/203a68151e8eeb331d4a64ab78303f3a15faf103"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ecc6a2101840177e57c925c102d2d29f260d37c8"
    }
  ],
  "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 vulnerability is reached through the bpf(2) syscall \u2014 BPF_MAP_CREATE for an oversized bloom-filter map followed by BPF_PROG_LOAD \u2014 which requires local access to the system. There is no remote or adjacent-network path into the BPF verifier.\nAC:L - The attacker fully controls both inputs that produce the overflow: the map's value_size (0x80000000 \u2192 INT_MIN) and the stack offset of the helper argument, making the out-of-bounds walk deterministic on every attempt with no race or unpredictable precondition.\nPR:L - Creating the BLOOM_FILTER map needs CAP_BPF, but that is a narrow delegated capability \u2014 not root \u2014 that is commonly granted to unprivileged observability/networking service accounts and containers, and the same map_create path supports BPF-token delegation into a user namespace; program load and the bpf_map_push_elem helper themselves need no extra privilege.\nUI:N - The entire sequence is performed by the attacker's own process via bpf(2); no action by any other user or administrator is needed.\nS:U - The out-of-bounds accesses corrupt kernel heap memory belonging to the verifier itself; impact stays within the kernel's security authority with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The loop performs unbounded out-of-bounds reads walking downward through the kernel heap below state->stack[], and the values read (including spilled_ptr.parent pointers) steer subsequent dereferences, giving an attacker-groomable kernel memory disclosure primitive.\nI:H - With clobber set, the verifier writes STACK_MISC bytes out of bounds, calls __mark_reg_unknown() to write a whole bpf_reg_state past the array, and mark_reg_read() does parent->live |= flag through a pointer read from out-of-bounds heap \u2014 a controllable write primitive suitable for privilege escalation via heap grooming.\nA:H - Even without successful exploitation the ~2-billion-iteration loop walks off the allocation and dereferences unmapped memory, producing a kernel oops/panic (this is exactly what syzkaller reported), and can be triggered repeatedly."
    }
  }
}
