CVE-2025-21648 Overview
A vulnerability has been identified in the Linux kernel's netfilter connection tracking (conntrack) subsystem where the maximum hashtable size is not properly clamped to INT_MAX. This oversight allows the hashtable resize operation to trigger a WARN_ON_ONCE condition in __kvmalloc_node_noprof() when the __GFP_NOWARN flag is unset during memory allocation for oversized hashtable requests. The vulnerability affects systems where hashtable resize operations are performed from the initial network namespace (init_netns).
Critical Impact
Local attackers with low privileges can trigger denial of service conditions by causing the kernel to hit warning conditions during conntrack hashtable resize operations, potentially disrupting network connection tracking functionality.
Affected Products
- Linux Kernel version 4.7 and later
- Linux Kernel versions 6.13-rc1 through 6.13-rc6
- Various stable Linux Kernel branches prior to patched versions
Discovery Timeline
- 2025-01-19 - CVE CVE-2025-21648 published to NVD
- 2025-11-03 - Last updated in NVD database
Technical Details for CVE-2025-21648
Vulnerability Analysis
The netfilter conntrack module maintains a hashtable to track network connections passing through the Linux firewall subsystem. When resizing this hashtable, the kernel allocates memory using kvmalloc(). The vulnerability arises because the maximum size for the conntrack hashtable was not properly bounded to INT_MAX, allowing allocation requests that exceed safe memory boundaries.
When an oversized allocation request is made without the __GFP_NOWARN flag set, the kernel's memory management subsystem triggers a WARN_ON_ONCE condition in __kvmalloc_node_noprof(). This behavior was documented in kernel commit 0708a0afe291 ("mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls"). The warning condition can lead to system instability and potential denial of service.
Root Cause
The root cause of this vulnerability is the absence of proper bounds checking on the conntrack hashtable size parameter. The code did not enforce a maximum size limit of INT_MAX before attempting memory allocation operations. This allowed the hashtable resize logic to request memory allocations that exceed safe integer boundaries, triggering kernel warning conditions and potentially causing allocation failures.
Attack Vector
The attack requires local access to the system with low-level privileges. An attacker must be able to trigger hashtable resize operations from the initial network namespace (init_netns). This could be accomplished by manipulating network connection parameters or system configuration to force the conntrack subsystem to resize its hashtable to an excessively large value. The attack does not require user interaction and can result in high availability impact through denial of service.
The vulnerability mechanism involves requesting a hashtable resize that exceeds INT_MAX, which then triggers the WARN_ON_ONCE() macro during the memory allocation attempt. While the warning itself is a debugging mechanism, repeatedly triggering it can cause system log flooding and may indicate underlying memory allocation issues that affect system stability.
Detection Methods for CVE-2025-21648
Indicators of Compromise
- Kernel log messages containing WARN_ON_ONCE from __kvmalloc_node_noprof() function
- Unusual memory allocation warnings in dmesg output related to netfilter or conntrack operations
- Unexpected increases in conntrack hashtable size parameters in /proc/sys/net/netfilter/
Detection Strategies
- Monitor kernel logs for warning messages originating from memory allocation functions in the netfilter conntrack path
- Implement alerting on WARN_ON_ONCE kernel messages that reference kvmalloc or conntrack components
- Track changes to conntrack hashtable configuration parameters in the init_netns namespace
Monitoring Recommendations
- Enable comprehensive kernel logging and forward to SIEM for analysis of netfilter-related warnings
- Deploy file integrity monitoring on kernel configuration files related to netfilter conntrack settings
- Monitor system stability metrics for signs of memory allocation stress or kernel warning rate increases
How to Mitigate CVE-2025-21648
Immediate Actions Required
- Update the Linux kernel to a patched version that includes the INT_MAX clamping fix for conntrack hashtable sizing
- Review and restrict access to network namespace operations, particularly for the init_netns
- Monitor system logs for any exploitation attempts while awaiting patch deployment
Patch Information
The Linux kernel development team has released patches that properly clamp the maximum conntrack hashtable size to INT_MAX. Multiple commits have been backported to stable kernel branches:
- Kernel Git Commit 5552b4f
- Kernel Git Commit a965f7f
- Kernel Git Commit b1b2353
- Kernel Git Commit b541ba7
- Kernel Git Commit d5807dd
- Kernel Git Commit f559357
Debian users should refer to the Debian LTS Security Announcements for March 2025 for distribution-specific patch information.
Workarounds
- Restrict local user access to systems running vulnerable kernel versions until patches can be applied
- Limit network namespace creation and management permissions to trusted administrators only
- Consider implementing additional access controls around netfilter configuration parameters
# Check current conntrack hashtable size configuration
cat /proc/sys/net/netfilter/nf_conntrack_buckets
# Monitor for kernel warnings related to this vulnerability
dmesg | grep -i "WARN_ON_ONCE\|kvmalloc\|conntrack"
# Verify kernel version includes the fix
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


