perf bpf: Avoid memory leak from perf_env__insert_btf()
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:
perf bpf: Avoid memory leak from perf_env__insert_btf()
perf_env__insert_btf() doesn't insert if a duplicate BTF id is encountered and this causes a memory leak. Modify the function to return a success/error value and then free the memory if insertion didn't happen.
v2. Adds a return -1 when the insertion error occurs in perf_env__fetch_btf. This doesn't affect anything as the result is never checked.
From the CVE record · Linux
The Linux kernel’s perf bpf code can leak memory when perf_env__insert_btf() encounters a duplicate BTF ID and does not insert it. The input does not specify how an attacker could trigger this condition or whether access or user interaction is required.
Engineers running Linux kernels with the affected perf bpf code should check their vendor’s advisory for affected versions.