MEDIUM 5.5

CVE-2026-53207: Linux Kernel hugetlb_lock Deadlock in Hardware Poison Handling

A deadlock vulnerability exists in the Linux kernel's memory failure handling code, specifically in how it manages hardware-poisoned huge pages. When two processes simultaneously call madvise(MADV_HWPOISON) on the same huge page while another thread unmaps the page, the kernel attempts to acquire the same spinlock twice, causing the system to hang. This is a kernel-level concurrency bug that requires local system access to trigger.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.5 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-667
Affected products
12 configuration(s)
Published / Modified
2026-06-25 / 2026-07-02

NVD description (verbatim)

In the Linux kernel, the following vulnerability has been resolved: mm/memory-failure: fix hugetlb_lock AA deadlock in get_huge_page_for_hwpoison Two concurrent madvise(MADV_HWPOISON) calls on the same hugetlb page can trigger a recursive spinlock self-deadlock (AA deadlock) on hugetlb_lock when racing with a concurrent unmap: thread#0 thread#1 -------- -------- madvise(folio, MADV_HWPOISON) -> poisons the folio successfully madvise(folio, MADV_HWPOISON) unmap(folio) try_memory_failure_hugetlb get_huge_page_for_hwpoison spin_lock_irq(&hugetlb_lock) <- held __get_huge_page_for_hwpoison hugetlb_update_hwpoison() -> MF_HUGETLB_FOLIO_PRE_POISONED goto out: folio_put() refcount: 1 -> 0 free_huge_folio() spin_lock_irqsave(&hugetlb_lock) -> AA DEADLOCK! The out: path in __get_huge_page_for_hwpoison() calls folio_put() to drop the GUP reference while the hugetlb_lock is still held by the hugetlb.c wrapper get_huge_page_for_hwpoison(). If concurrent unmap has released the page table mapping reference, folio_put() drops the folio refcount to zero, triggering free_huge_folio() which attempts to re-acquire the non-recursive hugetlb_lock. Fix this by moving hugetlb_lock acquisition from the hugetlb.c wrapper into get_huge_page_for_hwpoison(). Place spin_unlock_irq() before the folio_put() at the out: label so the folio is always released outside the lock. [[email protected]: fix race, rename label per Miaohe]

6 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability arises from a recursive spinlock acquisition (AA deadlock) on hugetlb_lock in the memory failure path. The issue occurs when get_huge_page_for_hwpoison() acquires hugetlb_lock at the wrapper level, then calls __get_huge_page_for_hwpoison() which handles the poisoned folio case (MF_HUGETLB_FOLIO_PRE_POISONED). When the out: path executes folio_put() to release the GUP reference while hugetlb_lock is still held, and the concurrent unmap has already dropped the page table reference, the folio refcount reaches zero, triggering free_huge_folio(). This function attempts to re-acquire the non-recursive hugetlb_lock, causing a deadlock. The fix relocates spin_lock_irq acquisition into get_huge_page_for_hwpoison() and moves spin_unlock_irq() before folio_put() to ensure the lock is released before any potential refcount-driven cleanup.

Business impact

This vulnerability enables a local denial of service attack. A user with standard privileges can cause the kernel to deadlock, freezing the system or making it unresponsive. On multi-tenant systems or shared servers, this could disrupt other users' workloads. The impact is limited to availability; no data corruption or privilege escalation is possible.

Affected systems

The Linux kernel is affected across multiple stable branches and distributions that include hugetlb memory failure handling code. The vulnerability requires a kernel compiled with huge page support (CONFIG_HUGETLB_PAGE). Systems without huge page support or those not exposing madvise(MADV_HWPOISON) to unprivileged users face reduced practical risk.

Exploitability

Exploitability is straightforward from a code perspective: two concurrent madvise() calls with MADV_HWPOISON on the same huge page while an unmap occurs in another thread can reliably trigger the deadlock. However, this requires local system access and knowledge of huge page allocation patterns. The vulnerability is not remotely exploitable and does not require elevated privileges. The race condition window is tight but deterministic under lab conditions, though reproducing it in production may require specific system load and timing conditions.

Remediation

The kernel fix involves refactoring the locking strategy in the memory failure code. The hugetlb_lock acquisition and release must be moved to ensure the lock is never held when folio_put() is called, preventing the recursive acquisition that triggers the deadlock. Verify the patch against your Linux distribution's official kernel advisory and apply updates as released by your vendor.

Patch guidance

Monitor your Linux vendor's security advisory channels and kernel update announcements for patches addressing this CVE. When patches become available, prioritize systems that (1) are configured with huge page support, (2) allow unprivileged madvise() calls, or (3) run memory-intensive workloads on shared systems. Test patches in a non-production environment first to ensure compatibility with your specific kernel configuration and workloads.

Detection guidance

System-level detection relies on identifying the conditions that trigger the bug: concurrent madvise(MADV_HWPOISON) calls on the same huge page combined with concurrent page unmapping. Monitor kernel logs for spinlock timeout warnings or hung task warnings mentioning hugetlb_lock. Use perf or other profiling tools to detect unexpected kernel spinlock contention on hugetlb_lock. A hung kernel process attempting to acquire hugetlb_lock while already holding it would appear as a process in 'D' state in ps output, though this indicates an active exploit attempt rather than benign activity.

Why prioritize this

While this is a medium-severity local denial of service, prioritization should account for your deployment model. Large shared systems, HPC clusters, and multi-tenant environments where huge pages are in active use should treat this as higher priority. Single-user systems or those without huge page workloads can defer patching. The lack of remote exploitability and privilege escalation potential makes this lower urgency than critical kernel bugs, but the ease of triggering a complete system hang justifies timely patching.

Risk score, explained

CVSS 3.1 score of 5.5 (Medium) reflects the vulnerability's local-only attack vector, low privilege requirement, and complete availability impact with no confidentiality or integrity compromise. The score correctly captures that while system-level damage is severe (system becomes unresponsive), the attack scope is limited to the local system and requires non-standard system calls and conditions.

Frequently asked questions

Can this vulnerability be exploited remotely?

No. The vulnerability requires local system access and direct invocation of madvise() syscalls, making remote exploitation impossible.

Do all Linux systems need to apply this patch?

Systems with CONFIG_HUGETLB_PAGE disabled in the kernel are unaffected. Those without huge page workloads or with madvise() restricted to privileged users face lower practical risk, though patching is still recommended for defense-in-depth.

What happens when the deadlock is triggered?

The kernel process attempting to re-acquire hugetlb_lock becomes stuck indefinitely, appearing as a hung task. On single-CPU systems, this may freeze the entire kernel. On multi-CPU systems, other workloads may continue but any kernel work requiring hugetlb_lock will stall.

Is this vulnerability related to data corruption?

No. The vulnerability is purely a concurrency bug that causes the system to hang. No memory corruption, data loss, or privilege escalation occurs.

This analysis is based on the provided CVE description and publicly available kernel vulnerability information as of the publication date. Patch availability, version numbers, and remediation timelines vary by Linux distribution and vendor. Consult your vendor's official security advisory for specific patch versions and support timelines. Testing in non-production environments is strongly recommended before deploying patches to production systems. This document does not constitute legal or contractual advice. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).