bpf: Protect against int overflow for stack access size
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a833a17aeac73b33f79433d7cee68d5cafd71e4f · < ecc6a2101840177e57c925c102d2d29f260d37c8| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
An overflowing signed stack-access size can cause out-of-bounds array accesses in the Linux kernel’s BPF program verifier. A program with such an access size can trigger the issue during verification; the input does not establish access, authentication, or user-interaction requirements.
Engineers running the Linux kernel should check their versions; affected versions are not specified in the input.