# CVE-2024-50253: bpf: Check the validity of nr_words in bpf_iter_bits_new()

- 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.19%, higher than 8% of CVEs (2026-12-01)
- Published: 2024-11-09T10:15:06.891Z
- Modified: 2026-08-05T11:42:47.547Z
- 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: Check the validity of nr_words in bpf_iter_bits_new()

Check the validity of nr_words in bpf_iter_bits_new(). Without this
check, when multiplication overflow occurs for nr_bits (e.g., when
nr_words = 0x0400-0001, nr_bits becomes 64), stack corruption may occur
due to bpf_probe_read_kernel_common(..., nr_bytes = 0x2000-0008).

Fix it by limiting the maximum value of nr_words to 511. The value is
derived from the current implementation of BPF memory allocator. To
ensure compatibility if the BPF memory allocator's size limitation
changes in the future, use the helper bpf_mem_alloc_check_size() to
check whether nr_bytes is too larger. And return -E2BIG instead of
-ENOMEM for oversized nr_bytes.

(As written by CVE List.)

## Affected

- Linux Linux: from 4665415975b0827e9646cab91c61d02a6b364d59 before c9539e09c67880ecd88b51188c346a2cc078b06c; from 4665415975b0827e9646cab91c61d02a6b364d59 before 393397fbdcad7396639d7077c33f86169184ba99; 6.11 (not affected: before 6.11; from 6.11.7 up to 6.11.*; from 6.12 up to *)
- linux linux_kernel: from 6.11 before 6.11.7; 6.12

## 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`
- CISA-ADP: 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`
- 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/c9539e09c67880ecd88b51188c346a2cc078b06c> (patch)
- <https://git.kernel.org/stable/c/393397fbdcad7396639d7077c33f86169184ba99> (patch)

## Sources

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

---

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