Name of the Vulnerable Software and Affected Versions:
Linux kernel (affected versions not specified)
Description:
The issue concerns a vulnerability in the Linux kernel where the function `bpf iter bits new()` does not properly check the validity of `nr words`. This can lead to stack corruption due to `bpf probe read kernel common()` when `nr words` causes a multiplication overflow, resulting in an incorrect `nr bits` value. For example, when `nr words` equals 0x0400-0001, `nr bits` becomes 64, potentially causing issues. The estimated number of potentially affected devices worldwide is not provided. There is no information about real-world incidents where this issue was exploited.
Recommendations:
To resolve the issue, limit the maximum value of `nr words` to 511, as derived from the current BPF memory allocator implementation. Use the helper function `bpf mem alloc check size()` to check if `nr bytes` is too large and return -E2BIG instead of -ENOMEM for oversized `nr bytes`. At the moment, there is no information about a newer version that contains a fix for this vulnerability.