# CVE-2024-45020: bpf: Fix a kernel verifier crash in stacksafe()

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 14% of CVEs (2026-12-01)
- Published: 2024-09-11T15:13:54.591Z
- Modified: 2026-08-05T11:37:44.844Z
- Weaknesses: CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix a kernel verifier crash in stacksafe()

Daniel Hodges reported a kernel verifier crash when playing with sched-ext.
Further investigation shows that the crash is due to invalid memory access
in stacksafe(). More specifically, it is the following code:

    if (exact != NOT_EXACT &&
        old->stack[spi].slot_type[i % BPF_REG_SIZE] !=
        cur->stack[spi].slot_type[i % BPF_REG_SIZE])
            return false;

The 'i' iterates old->allocated_stack.
If cur->allocated_stack < old->allocated_stack the out-of-bound
access will happen.

To fix the issue add 'i >= cur->allocated_stack' check such that if
the condition is true, stacksafe() should fail. Otherwise,
cur->stack[spi].slot_type[i % BPF_REG_SIZE] memory access is legal.

(As written by CVE List.)

## Affected

- Linux Linux: from ab470fefce2837e66b771c60858118d50bb5bb10 before 7cad3174cc79519bf5f6c4441780264416822c08; from 2793a8b015f7f1caadb9bce9c63dc659f7522676 before 6e3987ac310c74bb4dd6a2fa8e46702fe505fb2b; from 2793a8b015f7f1caadb9bce9c63dc659f7522676 before bed2eb964c70b780fb55925892a74f26cb590b25; from 6.6.15 before 6.6.48; 6.7 (not affected: before 6.7; from 6.6.48 up to 6.6.*; from 6.10.7 up to 6.10.*; from 6.11 up to *)
- linux linux_kernel: from 6.6.15 before 6.6.48; from 6.7 before 6.10.7; 6.11

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/7cad3174cc79519bf5f6c4441780264416822c08> (patch)
- <https://git.kernel.org/stable/c/6e3987ac310c74bb4dd6a2fa8e46702fe505fb2b> (patch)
- <https://git.kernel.org/stable/c/bed2eb964c70b780fb55925892a74f26cb590b25> (patch)

## Sources

- CVE List: [CVE-2024-45020](https://www.cve.org/CVERecord?id=CVE-2024-45020), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2024-45020](https://nvd.nist.gov/vuln/detail/CVE-2024-45020), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2024-45020 · Whole record: https://cve.day/CVE-2024-45020.json · Rebuilt by cve.day 2026-11-25T22:58:45.311Z
