# CVE-2023-52560: mm/damon/vaddr-test: fix memory leak in damon\_do\_test\_apply\_three\_regions()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 16, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2024-03-02T21:59:34.084Z
- **Modified:** 2026-06-17T06:43:01.610Z

## Who should check

- Anyone running Linux \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 9a4fe81a8644b717d57d81ce5849e16583b13fe8; \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 6b522001693aa113d97a985abc5f6932972e8e86; \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd
- Anyone running Linux 5.16

## Description

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

mm/damon/vaddr-test: fix memory leak in damon\_do\_test\_apply\_three\_regions()

When CONFIG\_DAMON\_VADDR\_KUNIT\_TEST=y and making CONFIG\_DEBUG\_KMEMLEAK=y
and CONFIG\_DEBUG\_KMEMLEAK\_AUTO\_SCAN=y, the below memory leak is detected.

Since commit 9f86d624292c ("mm/damon/vaddr-test: remove unnecessary
variables"), the damon\_destroy\_ctx() is removed, but still call
damon\_new\_target() and damon\_new\_region(), the damon\_region which is
allocated by kmem\_cache\_alloc() in damon\_new\_region() and the damon\_target
which is allocated by kmalloc in damon\_new\_target() are not freed.  And
the damon\_region which is allocated in damon\_new\_region() in
damon\_set\_regions() is also not freed.

So use damon\_destroy\_target to free all the damon\_regions and damon\_target.

    unreferenced object 0xffff888107c9a940 (size 64):
      comm "kunit\_try\_catch", pid 1069, jiffies 4294670592 (age 732.761s)
      hex dump (first 32 bytes):
        00 00 00 00 00 00 00 00 06 00 00 00 6b 6b 6b 6b  ............kkkk
        60 c7 9c 07 81 88 ff ff f8 cb 9c 07 81 88 ff ff  \`...............
      backtrace:
        \[\<ffffffff817e0167\>\] kmalloc\_trace+0x27/0xa0
        \[\<ffffffff819c11cf\>\] damon\_new\_target+0x3f/0x1b0
        \[\<ffffffff819c7d55\>\] damon\_do\_test\_apply\_three\_regions.constprop.0+0x95/0x3e0
        \[\<ffffffff819c82be\>\] damon\_test\_apply\_three\_regions1+0x21e/0x260
        \[\<ffffffff829fce6a\>\] kunit\_generic\_run\_threadfn\_adapter+0x4a/0x90
        \[\<ffffffff81237cf6\>\] kthread+0x2b6/0x380
        \[\<ffffffff81097add\>\] ret\_from\_fork+0x2d/0x70
        \[\<ffffffff81003791\>\] ret\_from\_fork\_asm+0x11/0x20
    unreferenced object 0xffff8881079cc740 (size 56):
      comm "kunit\_try\_catch", pid 1069, jiffies 4294670592 (age 732.761s)
      hex dump (first 32 bytes):
        05 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00  ................
        6b 6b 6b 6b 6b 6b 6b 6b 00 00 00 00 6b 6b 6b 6b  kkkkkkkk....kkkk
      backtrace:
        \[\<ffffffff819bc492\>\] damon\_new\_region+0x22/0x1c0
        \[\<ffffffff819c7d91\>\] damon\_do\_test\_apply\_three\_regions.constprop.0+0xd1/0x3e0
        \[\<ffffffff819c82be\>\] damon\_test\_apply\_three\_regions1+0x21e/0x260
        \[\<ffffffff829fce6a\>\] kunit\_generic\_run\_threadfn\_adapter+0x4a/0x90
        \[\<ffffffff81237cf6\>\] kthread+0x2b6/0x380
        \[\<ffffffff81097add\>\] ret\_from\_fork+0x2d/0x70
        \[\<ffffffff81003791\>\] ret\_from\_fork\_asm+0x11/0x20
    unreferenced object 0xffff888107c9ac40 (size 64):
      comm "kunit\_try\_catch", pid 1071, jiffies 4294670595 (age 732.843s)
      hex dump (first 32 bytes):
        00 00 00 00 00 00 00 00 06 00 00 00 6b 6b 6b 6b  ............kkkk
        a0 cc 9c 07 81 88 ff ff 78 a1 76 07 81 88 ff ff  ........x.v.....
      backtrace:
        \[\<ffffffff817e0167\>\] kmalloc\_trace+0x27/0xa0
        \[\<ffffffff819c11cf\>\] damon\_new\_target+0x3f/0x1b0
        \[\<ffffffff819c7d55\>\] damon\_do\_test\_apply\_three\_regions.constprop.0+0x95/0x3e0
        \[\<ffffffff819c851e\>\] damon\_test\_apply\_three\_regions2+0x21e/0x260
        \[\<ffffffff829fce6a\>\] kunit\_generic\_run\_threadfn\_adapter+0x4a/0x90
        \[\<ffffffff81237cf6\>\] kthread+0x2b6/0x380
        \[\<ffffffff81097add\>\] ret\_from\_fork+0x2d/0x70
        \[\<ffffffff81003791\>\] ret\_from\_fork\_asm+0x11/0x20
    unreferenced object 0xffff8881079ccc80 (size 56):
      comm "kunit\_try\_catch", pid 1071, jiffies 4294670595 (age 732.843s)
      hex dump (first 32 bytes):
        05 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00  ................
        6b 6b 6b 6b 6b 6b 6b 6b 00 00 00 00 6b 6b 6b 6b  kkkkkkkk....kkkk
      backtrace:
        \[\<ffffffff819bc492\>\] damon\_new\_region+0x22/0x1c0
        \[\<ffffffff819c7d91\>\] damon\_do\_test\_apply\_three\_regions.constprop.0+0xd1/0x3e0
        \[\<ffffffff819c851e\>\] damon\_test\_apply\_three\_regions2+0x21e/0x260
        \[\<ffffffff829fce6a\>\] kunit\_generic\_run\_threadfn\_adapter+0x4a/0x90
        \[\<ffffffff81237cf6\>\] kthread+0x2b6/0x380
        \[\<ffffffff81097add\>\] ret\_from\_fork+0x2d/0x70
        \[\<ffff
---truncated---

## Affected and fixed versions

- Linux: \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 9a4fe81a8644b717d57d81ce5849e16583b13fe8; \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 6b522001693aa113d97a985abc5f6932972e8e86; \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd (cvelist)
- Linux: 5.16 (cvelist)

## Mitigation

- Upgrade Linux to 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-52560. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52560.md
Affected: Linux >= 9f86d624292c238203b3687cdb870a2cde1a6f9b, < 9a4fe81a8644b717d57d81ce5849e16583b13fe8; >= 9f86d624292c238203b3687cdb870a2cde1a6f9b, < 6b522001693aa113d97a985abc5f6932972e8e86; >= 9f86d624292c238203b3687cdb870a2cde1a6f9b, < 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd; Linux 5.16
Fixed in: Linux 9a4fe81a8644b717d57d81ce5849e16583b13fe8, Linux 6b522001693aa113d97a985abc5f6932972e8e86, Linux 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-52560 being exploited?

There is no confirmed exploitation: CVE-2023-52560 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-52560?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-52560?

Linux \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 9a4fe81a8644b717d57d81ce5849e16583b13fe8; \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 6b522001693aa113d97a985abc5f6932972e8e86; \>= 9f86d624292c238203b3687cdb870a2cde1a6f9b, \< 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd; Linux 5.16.

### Is there a fix for CVE-2023-52560?

Yes. Fixed in Linux 9a4fe81a8644b717d57d81ce5849e16583b13fe8, Linux 6b522001693aa113d97a985abc5f6932972e8e86, Linux 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd. Upgrade Linux to 45120b15743fa7c0aa53d5db6dfb4c8f87be4abd or later.

### How do I check if I'm affected by CVE-2023-52560?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/9a4fe81a8644b717d57d81ce5849e16583b13fe8>
- patch: <https://git.kernel.org/stable/c/6b522001693aa113d97a985abc5f6932972e8e86>
- patch: <https://git.kernel.org/stable/c/45120b15743fa7c0aa53d5db6dfb4c8f87be4abd>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-52560>

HTML: <https://flawdb.com/CVE-2023-52560> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-52560>
