mm/kmemleak: avoid soft lockup in __kmemleak_do_cleanup()
Published Sep 11, 2025
5.5
MEDIUMCVSS 3.1
EPSS 0.18%
Description
A soft lockup warning was observed on a relative small system x86-64 system with 16 GB of memory when running a debug kernel with kmemleak enabled.
watchdog: BUG: soft lockup - CPU#8 stuck for 33s! [kworker/8:1:134]
The test system was running a workload with hot unplug happening in parallel. Then kemleak decided to disable itself due to its inability to allocate more kmemleak objects. The debug kernel has its CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE set to 40,000.
The soft lockup happened in kmemleak_do_cleanup() when the existing kmemleak objects were being removed and deleted one-by-one in a loop via a workqueue. In this particular case, there are at least 40,000 objects that need to be processed and given the slowness of a debug kernel and the fact that a raw_spinlock has to be acquired and released in __delete_object(), it could take a while to properly handle all these objects.
As kmemleak has been disabled in this case, the object removal and deletion process can be further optimized as locking isn't really needed. However, it is probably not worth the effort to optimize for such an edge case that should rarely happen. So the simple solution is to call cond_resched() at periodic interval in the iteration loop to avoid soft lockup.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 5.4StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<5.4
- Version 5.10.241StatusunaffectedConstraints<=5.10.*
- Version 5.15.190StatusunaffectedConstraints<=5.15.*
- Version 5.4.297StatusunaffectedConstraints<=5.4.*
- Version 6.1.149StatusunaffectedConstraints<=6.1.*
- Version 6.12.43StatusunaffectedConstraints<=6.12.*
- Version 6.15.11StatusunaffectedConstraints<=6.15.*
- Version 6.16.2StatusunaffectedConstraints<=6.16.*
- Version 6.17StatusunaffectedConstraints<=*
- Version 6.6.103StatusunaffectedConstraints<=6.6.*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Linux | Linux | unaffected |
| ||||||||||||||||||||||||||||||||||||
| Linux | Linux | affected |
|
Configuration 1
- ≥ 5.4.1 · < 5.4.297
- ≥ 5.5 · < 5.10.241
- ≥ 5.11 · < 5.15.190
- ≥ 5.16 · < 6.1.149
- ≥ 6.2 · < 6.6.103
- ≥ 6.7 · < 6.12.43
- ≥ 6.13 · < 6.15.11
- ≥ 6.16 · < 6.16.2
- 5.4
- 5.4
- 5.4
- 5.4
- 5.4
- 5.4
- 6.17
Configuration 2
- 11.0
No data.
Red Hat Enterprise Linux 10
kernel
Fix deferred
Red Hat Enterprise Linux 6
kernel
Out of support scope
Red Hat Enterprise Linux 7
kernel
Fix deferred
Red Hat Enterprise Linux 7
kernel-rt
Fix deferred
Red Hat Enterprise Linux 8
kernel
Fix deferred
Red Hat Enterprise Linux 8
kernel-rt
Fix deferred
Red Hat Enterprise Linux 9
kernel
Fix deferred
Red Hat Enterprise Linux 9
kernel-rt
Fix deferred
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 10 | kernel | Fix deferred | n/a |
| Red Hat Enterprise Linux 6 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 7 | kernel | Fix deferred | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Fix deferred | n/a |
| Red Hat Enterprise Linux 8 | kernel | Fix deferred | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Fix deferred | n/a |
| Red Hat Enterprise Linux 9 | kernel | Fix deferred | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Fix deferred | n/a |
No package ranges for this CVE.
Remediation
No remediation recorded yet.
References (18)
- https://access.redhat.com/security/cve/CVE-2025-39737 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2394643 Issue Tracking
- https://cert-portal.siemens.com/productcert/html/ssa-032379.html
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-28974 Advisory
- https://git.kernel.org/stable/c/1ef72a7fedc5bca70e8cc980985790de10d407aa Patch
- https://git.kernel.org/stable/c/8d2d22a55ffe35c38e69795468a7addd1a80e9ce Patch
- https://git.kernel.org/stable/c/926092268efdf1ed7b55cf486356c74a9e7710d1 Patch
- https://git.kernel.org/stable/c/9b80430c194e4a114dc663c1025d56b4f3d0153d Patch
- https://git.kernel.org/stable/c/9f1f4e95031f84867c5821540466d62f88dab8ca Patch
- https://git.kernel.org/stable/c/a04de4c40aab9b338dfa989cf4aec70fd187eeb2 Patch
- https://git.kernel.org/stable/c/d1534ae23c2b6be350c8ab060803fbf6e9682adc Patch
- https://git.kernel.org/stable/c/e21a3ddd58733ce31afcb1e5dc3cb80a4b5bc29b Patch
- https://git.kernel.org/stable/c/f014c10d190b92aad366e56b445daffcd1c075e4 Patch
- https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html Mailing ListThird Party Advisory
- https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html Mailing ListThird Party Advisory
- https://lore.kernel.org/linux-cve-announce/2025091137-CVE-2025-39737-f096@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2025-39737
- https://www.cve.org/CVERecord?id=CVE-2025-39737
Change history (0)
No recorded changes yet.