{"id":"CVE-2021-46937","state":"PUBLISHED","title":"mm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()'","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()'\n\nDAMON debugfs interface increases the reference counts of 'struct pid's\nfor targets from the 'target_ids' file write callback\n('dbgfs_target_ids_write()'), but decreases the counts only in DAMON\nmonitoring termination callback ('dbgfs_before_terminate()').\n\nTherefore, when 'target_ids' file is repeatedly written without DAMON\nmonitoring start/termination, the reference count is not decreased and\ntherefore memory for the 'struct pid' cannot be freed.  This commit\nfixes this issue by decreasing the reference counts when 'target_ids' is\nwritten.","publishedAt":"2024-02-27T09:44:03.421Z","updatedAt":"2026-05-11T13:44:47.438Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4bc05954d0076655cfaf6f0135585bdc20cd6b11","status":"affected","lessThan":"ffe4a1ba1a82c416a6b3a09d46594f6a885ae141","versionType":"git"},{"version":"4bc05954d0076655cfaf6f0135585bdc20cd6b11","status":"affected","lessThan":"ebb3f994dd92f8fb4d70c7541091216c1e10cb71","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/damon/dbgfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"5.15.13","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/damon/dbgfs.c"]}],"references":["https://git.kernel.org/stable/c/ffe4a1ba1a82c416a6b3a09d46594f6a885ae141","https://git.kernel.org/stable/c/ebb3f994dd92f8fb4d70c7541091216c1e10cb71"],"weaknesses":[],"ingestedAt":"2026-10-29T19:49:16.371Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2021/46xxx/CVE-2021-46937.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2021-46937","state":"PUBLISHED","datePublished":"2024-02-27T09:44:03.421Z","dateUpdated":"2026-05-11T13:44:47.438Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-02-25T13:45:52.721Z"},"containers":{"cna":{"title":"mm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()'","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()'\n\nDAMON debugfs interface increases the reference counts of 'struct pid's\nfor targets from the 'target_ids' file write callback\n('dbgfs_target_ids_write()'), but decreases the counts only in DAMON\nmonitoring termination callback ('dbgfs_before_terminate()').\n\nTherefore, when 'target_ids' file is repeatedly written without DAMON\nmonitoring start/termination, the reference count is not decreased and\ntherefore memory for the 'struct pid' cannot be freed.  This commit\nfixes this issue by decreasing the reference counts when 'target_ids' is\nwritten."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4bc05954d0076655cfaf6f0135585bdc20cd6b11","status":"affected","lessThan":"ffe4a1ba1a82c416a6b3a09d46594f6a885ae141","versionType":"git"},{"version":"4bc05954d0076655cfaf6f0135585bdc20cd6b11","status":"affected","lessThan":"ebb3f994dd92f8fb4d70c7541091216c1e10cb71","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/damon/dbgfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"5.15.13","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/damon/dbgfs.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/ffe4a1ba1a82c416a6b3a09d46594f6a885ae141"},{"url":"https://git.kernel.org/stable/c/ebb3f994dd92f8fb4d70c7541091216c1e10cb71"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T13:44:47.438Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"5.15.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"5.16"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2021-46937","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-02-27T15:48:08.860920Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-07-05T17:22:00.927Z"}},{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/ffe4a1ba1a82c416a6b3a09d46594f6a885ae141","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/ebb3f994dd92f8fb4d70c7541091216c1e10cb71","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-04T05:17:43.028Z"}}]}}}