CVE-2025-39843
Medium · 5.5CVSS
5.5
EPSS
0.1%
Published
Sep 19, 2025
CISA due date
—
Cloudanix analysis
A bug in the Linux kernel's memory handling can cause the system to crash or freeze when certain debugging features are turned on, and updating the kernel fixes it.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- OS kernel
- Class
- Race Condition
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Lock recursion deadlock in SLUB allocator: set_track_prepare() called under hrtimer lock can wake kswapd via __GFP_KSWAPD_RECLAIM, leading to spinlock recursion on per-CPU hrtimer_bases when CONFIG_DEBUG_OBJECTS_TIMERS is enabled.
Why it matters to the business
Systems may experience kernel oops, hangs, or crashes during memory allocation under timer debugging, reducing availability and requiring reboots; high prevalence in Linux distributions amplifies operational disruption for servers and embedded devices.
How an attack unfolds
An attacker with local access triggers slab allocations (e.g., via kmem_cache or debug object activation) while hrtimer_start_range_ns holds the lock; the GFP flags cause kswapd wake-up, recursing on the same lock and producing the spinlock recursion BUG.
How to fix it
Upgrade Linux kernel packages to the fixed versions: Debian 11/12/13/14 to 3.16.2-2 or later; mainline/stable git trees to commit 994b03b9605d36d814c611385fbf90ca6db20aa8 or equivalent backports that pass non-reclaim GFP flags to debug_objects_fill_pool and mask __GFP_DIRECT_RECLAIM in ___slub_alloc.
How to confirm the fix worked
Verify running kernel version matches or exceeds the fixed package/commit; confirm CONFIG_DEBUG_OBJECTS_TIMERS is either disabled or the patch applied by checking for the gfp_nested_mask and allocation flag changes; attempt to reproduce the original oops under the debug config to validate absence of recursion.
Typical attack path
- Obtain local code execution or trigger memory pressure
- Invoke paths that call hrtimer_start_range_ns under CONFIG_DEBUG_OBJECTS_TIMERS
- Trigger slab allocation in debug_objects_fill_pool or set_track_prepare
- Cause kswapd wake-up while holding per-CPU hrtimer lock
- Induce spinlock recursion and kernel panic
How to detect it
Search kernel logs and dmesg for the exact BUG string 'spinlock recursion on CPU' combined with 'swapper' and the call trace containing hrtimer_try_to_cancel, wakeup_kswapd, set_track_prepare, and debug_objects_fill_pool; look for occurrences on systems with CONFIG_DEBUG_OBJECTS_TIMERS enabled.
- BUG: spinlock recursion on CPU
- lock: 0xffffff8a4bf29c80
- hrtimer_try_to_cancel+0x94
- wakeup_kswapd+0x19c
- set_track_prepare+0x5c
- debug_objects_fill_pool+0x22c
- Hardware name: Qualcomm Technologies, Inc. Popsicle based on SM8850
What your security team should do
- Immediately prioritize kernel upgrades on all affected Debian and custom Linux deployments due to 400+ days since publication
- Audit systems for CONFIG_DEBUG_OBJECTS_TIMERS=y in production kernels and consider disabling it where feasible
- Monitor for spinlock recursion oopses in dmesg and kernel logs as a temporary detection measure
- Apply the exact fixed versions listed for each distribution to eliminate the GFP flag recursion path
The record
In the Linux kernel, the following vulnerability has been resolved: mm: slub: avoid wake up kswapd in set_track_prepare set_track_prepare() can incur lock recursion. The issue is that it is called from hrtimer_start_range_ns holding the per_cpu(hrtimer_bases)[n].lock, but when enabled CONFIG_DEBUG_OBJECTS_TIMERS, may wake up kswapd in set_track_prepare, and try to hold the per_cpu(hrtimer_bases)[n].lock. Avoid deadlock caused by implicitly waking up kswapd by passing in allocation flags, which do not contain __GFP_KSWAPD_RECLAIM in the debug_objects_fill_pool() case. Inside stack depot they are processed by gfp_nested_mask(). Since ___slab_alloc() has preemption disabled, we mask out __GFP_DIRECT_RECLAIM from the flags there. The oops looks something like: BUG: spinlock recursion on CPU#3, swapper/3/0 lock: 0xffffff8a4bf29c80, .magic: dead4ead, .owner: swapper/3/0, .owner_cpu: 3 Hardware name: Qualcomm Technologies, Inc. Popsicle based on SM8850 (DT) Call trace: spin_bug+0x0 _raw_spin_lock_irqsave+0x80 hrtimer_try_to_cancel+0x94 task_contending+0x10c enqueue_dl_entity+0x2a4 dl_server_start+0x74 enqueue_task_fair+0x568 enqueue_task+0xac do_activate_task+0x14c ttwu_do_activate+0xcc try_to_wake_up+0x6c8 default_wake_function+0x20 autoremove_wake_function+0x1c __wake_up+0xac wakeup_kswapd+0x19c wake_all_kswapds+0x78 __alloc_pages_slowpath+0x1ac __alloc_pages_noprof+0x298 stack_depot_save_flags+0x6b0 stack_depot_save+0x14 set_track_prepare+0x5c ___slab_alloc+0xccc __kmalloc_cache_noprof+0x470 __set_page_owner+0x2bc post_alloc_hook[jt]+0x1b8 prep_new_page+0x28 get_page_from_freelist+0x1edc __alloc_pages_noprof+0x13c alloc_slab_page+0x244 allocate_slab+0x7c ___slab_alloc+0x8e8 kmem_cache_alloc_noprof+0x450 debug_objects_fill_pool+0x22c debug_object_activate+0x40 enqueue_hrtimer[jt]+0xdc hrtimer_start_range_ns+0x5f8 ...
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:10 | kernel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-debug | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-debug-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-debug-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-debug-devel-matched | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-debug-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-debug-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-debug-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-devel-matched | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-64k-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-abi-stablelists | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-cross-headers | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug-devel-matched | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-debug-uki-virt | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-devel-matched | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-doc | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-headers | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-modules-extra-matched | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-debug | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-debug-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-debug-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-debug-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-debug-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-debug-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-64k-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-debug | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-debug-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-debug-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-debug-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-debug-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-debug-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-rt-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-tools | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-tools-libs | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-tools-libs-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-uki-virt | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-uki-virt-addons | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-zfcpdump | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-zfcpdump-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-zfcpdump-devel | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-zfcpdump-devel-matched | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-zfcpdump-modules | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-zfcpdump-modules-core | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | kernel-zfcpdump-modules-extra | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | libperf | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | perf | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | python3-perf | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | rtla | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:10 | rv | 0 | 6.12.0-124.27.1.el10_1 |
| AlmaLinux:9 | kernel | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-core | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-core | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-devel | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-devel-matched | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-modules | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-modules-extra | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-devel | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-devel-matched | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-64k-modules-extra | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-abi-stablelists | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-debug-devel | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-debug-devel-matched | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-devel | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-devel-matched | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-doc | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-headers | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-devel | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-devel-matched | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | perf | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | python3-perf | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | rtla | 0 | 5.14.0-611.9.1.el9_7 |
| AlmaLinux:9 | rv | 0 | 5.14.0-611.9.1.el9_7 |
| Debian:12 | linux | 0 | 6.1.153-1 |
| Debian:13 | linux | 0 | 6.12.48-1 |
| Debian:14 | linux | 0 | 6.16.6-1 |
| Linux | Kernel | 5.19.0 | 6.1.151 |
Related vulnerabilities
- CVE-2025-68285 In the Linux kernel, the following vulnerability has been resolved: libceph: fix… Also affects kernel
- CVE-2025-68287 In the Linux kernel, the following vulnerability has been resolved: usb: dwc3: Fix race… Also affects kernel
- CVE-2025-40277 In the Linux kernel, the following vulnerability has been resolved: drm/vmwgfx: Validate… Also affects kernel
- CVE-2025-40240 In the Linux kernel, the following vulnerability has been resolved: sctp: avoid NULL… Also affects kernel
- CVE-2025-40185 In the Linux kernel, the following vulnerability has been resolved: ice: ice_adapter… Also affects kernel
- CVE-2025-40176 In the Linux kernel, the following vulnerability has been resolved: tls: wait for pending… Also affects kernel
- CVE-2025-40058 In the Linux kernel, the following vulnerability has been resolved: iommu/vt-d: Disallow… Also affects kernel
- CVE-2025-40047 In the Linux kernel, the following vulnerability has been resolved: io_uring/waitid… Also affects kernel