# CVE-2021-47190: perf bpf: Avoid memory leak from perf_env__insert_btf()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 15% of CVEs (2026-12-01)
- Published: 2024-04-10T18:56:28.815Z
- Modified: 2026-06-17T04:16:52.367Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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.

(As written by CVE List.)

## Affected

- Linux Linux: from 3792cb2ff43b1b193136a03ce1336462a827d792 before 642fc22210a5e59d40b1e4d56d21ec3effd401f2; from 3792cb2ff43b1b193136a03ce1336462a827d792 before 11589d3144bc4e272e0aae46ce8156162e99babc; from 3792cb2ff43b1b193136a03ce1336462a827d792 before ab7c3d8d81c511ddfb27823fb07081c96422b56e; from 3792cb2ff43b1b193136a03ce1336462a827d792 before 4924b1f7c46711762fd0e65c135ccfbcfd6ded1f; 5.1 (not affected: before 5.1; from 5.4.162 up to 5.4.*; from 5.10.82 up to 5.10.*; from 5.15.5 up to 5.15.*; from 5.16 up to *)
- linux linux_kernel: from 5.1 before 5.4.162; from 5.5 before 5.10.82; from 5.11 before 5.15.5

## References

- <https://git.kernel.org/stable/c/642fc22210a5e59d40b1e4d56d21ec3effd401f2> (patch)
- <https://git.kernel.org/stable/c/11589d3144bc4e272e0aae46ce8156162e99babc> (patch)
- <https://git.kernel.org/stable/c/ab7c3d8d81c511ddfb27823fb07081c96422b56e> (patch)
- <https://git.kernel.org/stable/c/4924b1f7c46711762fd0e65c135ccfbcfd6ded1f> (patch)

## Sources

- CVE List: [CVE-2021-47190](https://www.cve.org/CVERecord?id=CVE-2021-47190), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2021-47190](https://nvd.nist.gov/vuln/detail/CVE-2021-47190), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-47190 · Whole record: https://cve.day/CVE-2021-47190.json · Rebuilt by cve.day 2026-11-25T22:58:08.710Z
