# CVE-2021-46937: mm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()'

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`
- 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.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2024-02-27T09:44:03.421Z
- Modified: 2026-06-17T04:15:54.820Z
- Weaknesses: CWE-668
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

mm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()'

DAMON debugfs interface increases the reference counts of 'struct pid's
for targets from the 'target_ids' file write callback
('dbgfs_target_ids_write()'), but decreases the counts only in DAMON
monitoring termination callback ('dbgfs_before_terminate()').

Therefore, when 'target_ids' file is repeatedly written without DAMON
monitoring start/termination, the reference count is not decreased and
therefore memory for the 'struct pid' cannot be freed.  This commit
fixes this issue by decreasing the reference counts when 'target_ids' is
written.

(As written by CVE List.)

## Affected

- Linux Linux: from 4bc05954d0076655cfaf6f0135585bdc20cd6b11 before ffe4a1ba1a82c416a6b3a09d46594f6a885ae141; from 4bc05954d0076655cfaf6f0135585bdc20cd6b11 before ebb3f994dd92f8fb4d70c7541091216c1e10cb71; 5.15 (not affected: before 5.15; from 5.15.13 up to 5.15.*; from 5.16 up to *)
- linux linux_kernel: from 5.15.0 before 5.15.13

## References

- <https://git.kernel.org/stable/c/ffe4a1ba1a82c416a6b3a09d46594f6a885ae141> (patch)
- <https://git.kernel.org/stable/c/ebb3f994dd92f8fb4d70c7541091216c1e10cb71> (patch)

## Sources

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

---

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