Bug 2324882 (CVE-2024-50253) - CVE-2024-50253 kernel: bpf: Check the validity of nr_words in bpf_iter_bits_new()
Summary: CVE-2024-50253 kernel: bpf: Check the validity of nr_words in bpf_iter_bits_n...
Keywords:
Status: NEW
Alias: CVE-2024-50253
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2325103
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-11-09 11:03 UTC by OSIDB Bzimport
Modified: 2024-11-21 18:59 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-11-09 11:03:06 UTC
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.

Comment 1 Avinash Hanwate 2024-11-11 05:57:19 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024110937-CVE-2024-50253-7a6b@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.