Skip to main content

CVE-2025-21884: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-21884cvecve-2025-21884
Published: Thu Mar 27 2025 (03/27/2025, 14:57:12 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: better track kernel sockets lifetime While kernel sockets are dismantled during pernet_operations->exit(), their freeing can be delayed by any tx packets still held in qdisc or device queues, due to skb_set_owner_w() prior calls. This then trigger the following warning from ref_tracker_dir_exit() [1] To fix this, make sure that kernel sockets own a reference on net->passive. Add sk_net_refcnt_upgrade() helper, used whenever a kernel socket is converted to a refcounted one. [1] [ 136.263918][ T35] ref_tracker: net notrefcnt@ffff8880638f01e0 has 1/2 users at [ 136.263918][ T35] sk_alloc+0x2b3/0x370 [ 136.263918][ T35] inet6_create+0x6ce/0x10f0 [ 136.263918][ T35] __sock_create+0x4c0/0xa30 [ 136.263918][ T35] inet_ctl_sock_create+0xc2/0x250 [ 136.263918][ T35] igmp6_net_init+0x39/0x390 [ 136.263918][ T35] ops_init+0x31e/0x590 [ 136.263918][ T35] setup_net+0x287/0x9e0 [ 136.263918][ T35] copy_net_ns+0x33f/0x570 [ 136.263918][ T35] create_new_namespaces+0x425/0x7b0 [ 136.263918][ T35] unshare_nsproxy_namespaces+0x124/0x180 [ 136.263918][ T35] ksys_unshare+0x57d/0xa70 [ 136.263918][ T35] __x64_sys_unshare+0x38/0x40 [ 136.263918][ T35] do_syscall_64+0xf3/0x230 [ 136.263918][ T35] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 136.263918][ T35] [ 136.343488][ T35] ref_tracker: net notrefcnt@ffff8880638f01e0 has 1/2 users at [ 136.343488][ T35] sk_alloc+0x2b3/0x370 [ 136.343488][ T35] inet6_create+0x6ce/0x10f0 [ 136.343488][ T35] __sock_create+0x4c0/0xa30 [ 136.343488][ T35] inet_ctl_sock_create+0xc2/0x250 [ 136.343488][ T35] ndisc_net_init+0xa7/0x2b0 [ 136.343488][ T35] ops_init+0x31e/0x590 [ 136.343488][ T35] setup_net+0x287/0x9e0 [ 136.343488][ T35] copy_net_ns+0x33f/0x570 [ 136.343488][ T35] create_new_namespaces+0x425/0x7b0 [ 136.343488][ T35] unshare_nsproxy_namespaces+0x124/0x180 [ 136.343488][ T35] ksys_unshare+0x57d/0xa70 [ 136.343488][ T35] __x64_sys_unshare+0x38/0x40 [ 136.343488][ T35] do_syscall_64+0xf3/0x230 [ 136.343488][ T35] entry_SYSCALL_64_after_hwframe+0x77/0x7f

AI-Powered Analysis

AILast updated: 06/30/2025, 10:14:07 UTC

Technical Analysis

CVE-2025-21884 is a vulnerability identified in the Linux kernel related to the management of kernel socket lifetimes during network namespace teardown operations. Specifically, the issue arises during the execution of pernet_operations->exit(), when kernel sockets are dismantled. The freeing of these sockets can be delayed due to transmission (tx) packets still queued in the queuing discipline (qdisc) or device queues. This delay is caused by prior calls to skb_set_owner_w(), which sets ownership of socket buffers (skbs). The delayed freeing leads to a reference counting inconsistency, triggering warnings from the kernel's reference tracker (ref_tracker_dir_exit()). The vulnerability is rooted in the kernel sockets not properly owning a reference on net->passive, which is critical for accurate reference counting and resource cleanup. The fix involves ensuring kernel sockets hold a reference on net->passive and introducing a helper function, sk_net_refcnt_upgrade(), to manage the transition of kernel sockets to refcounted ones. The kernel logs included show the warning messages and stack traces related to this issue, indicating potential resource leaks or improper cleanup during network namespace unsharing and socket creation. Although no known exploits are reported in the wild, this flaw could lead to resource exhaustion or instability in systems heavily utilizing network namespaces and kernel sockets, such as containerized environments or virtualized network stacks.

Potential Impact

For European organizations, especially those relying on Linux-based infrastructure for cloud services, container orchestration (e.g., Kubernetes), or network virtualization, this vulnerability could result in kernel resource leaks or system instability. The delayed freeing of kernel sockets may cause increased memory usage and potential denial of service conditions if resources are exhausted. This is particularly relevant for data centers, telecom providers, and enterprises running multi-tenant environments where network namespaces are extensively used. While the vulnerability does not directly expose confidentiality or integrity risks, the availability impact could disrupt critical services and applications. Organizations with high-density Linux deployments or those using advanced networking features may experience degraded performance or unexpected kernel warnings, complicating system management and monitoring.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should prioritize updating their Linux kernels to versions that include the patch for CVE-2025-21884 as soon as they become available. In the interim, system administrators should monitor kernel logs for ref_tracker warnings indicative of this issue. Reducing the use of network namespaces or limiting the frequency of namespace unsharing operations can help minimize exposure. Additionally, organizations should audit their container and virtualization platforms to ensure they are running supported kernel versions and apply vendor-specific patches promptly. Implementing robust resource monitoring and alerting for unusual kernel memory usage or socket counts can provide early detection of exploitation attempts or resource exhaustion. Collaboration with Linux distribution vendors to receive timely security updates is also critical.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-29T08:45:45.782Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9832c4522896dcbe8b00

Added to database: 5/21/2025, 9:09:06 AM

Last enriched: 6/30/2025, 10:14:07 AM

Last updated: 8/18/2025, 11:32:56 PM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats