bpf: add check for invalid name in btf_name_valid_section()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: add check for invalid name in btf_name_valid_section()
If the length of the name string is 1 and the value of name[0] is NULL byte, an OOB vulnerability occurs in btf_name_valid_section() and the return value is true, so the invalid name passes the check.
To solve this, you need to check if the first position is NULL byte and if the first character is printable.
From the CVE record · Linux
The Linux kernel's btf_name_valid_section() can read out of bounds and accept an invalid name when the name is a single NULL byte. The input does not specify how an attacker could supply the name or whether access or user interaction is required.
Engineers running the Linux kernel should check their version; affected versions are not specified in the input.