bpf: reject direct access to nullable PTR_TO_BUF pointers
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 20b2aff4bc15bda809f994761d5719827d66c0b4 · < 4f6c99dc0420f1a3d671c1b8ab8a7ac84d9cba09| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: reject direct access to nullable PTR_TO_BUF pointers
check_mem_access() matches PTR_TO_BUF via base_type() which strips PTR_MAYBE_NULL, allowing direct dereference without a null check.
Map iterator ctx->key and ctx->value are PTR_TO_BUF | PTR_MAYBE_NULL. On stop callbacks these are NULL, causing a kernel NULL dereference.
Add a type_may_be_null() guard to the PTR_TO_BUF branch, matching the existing PTR_TO_BTF_ID pattern.
From the CVE record · Linux
The Linux kernel’s BPF memory access checks allow direct access to nullable map iterator key and value pointers without a null check. A program that dereferences these pointers in a stop callback can trigger a kernel NULL dereference. The input does not specify access or authentication requirements.
Engineers running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified in the input.