Skip to main content

CVE-2025-21857: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-21857cvecve-2025-21857
Published: Wed Mar 12 2025 (03/12/2025, 09:42:10 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net/sched: cls_api: fix error handling causing NULL dereference tcf_exts_miss_cookie_base_alloc() calls xa_alloc_cyclic() which can return 1 if the allocation succeeded after wrapping. This was treated as an error, with value 1 returned to caller tcf_exts_init_ex() which sets exts->actions to NULL and returns 1 to caller fl_change(). fl_change() treats err == 1 as success, calling tcf_exts_validate_ex() which calls tcf_action_init() with exts->actions as argument, where it is dereferenced. Example trace: BUG: kernel NULL pointer dereference, address: 0000000000000000 CPU: 114 PID: 16151 Comm: handler114 Kdump: loaded Not tainted 5.14.0-503.16.1.el9_5.x86_64 #1 RIP: 0010:tcf_action_init+0x1f8/0x2c0 Call Trace: tcf_action_init+0x1f8/0x2c0 tcf_exts_validate_ex+0x175/0x190 fl_change+0x537/0x1120 [cls_flower]

AI-Powered Analysis

AILast updated: 06/30/2025, 09:57:42 UTC

Technical Analysis

CVE-2025-21857 is a vulnerability identified in the Linux kernel's network scheduler component, specifically within the cls_api module responsible for handling classifier extensions. The issue arises from improper error handling in the function tcf_exts_miss_cookie_base_alloc(), which internally calls xa_alloc_cyclic(). This function can return the value 1 to indicate a successful allocation after wrapping, but the Linux kernel code erroneously treats this return value as an error. Consequently, tcf_exts_init_ex() sets the exts->actions pointer to NULL and returns 1 to its caller fl_change(). However, fl_change() interprets an error code of 1 as a success condition and proceeds to call tcf_exts_validate_ex(), which in turn calls tcf_action_init() with the NULL exts->actions pointer. This leads to a NULL pointer dereference and a kernel crash (BUG), causing a denial of service (DoS) condition. The vulnerability is triggered during network traffic control operations, particularly when modifying filter actions (fl_change). The kernel crash is demonstrated by the provided stack trace, showing the fault at tcf_action_init(). This vulnerability affects Linux kernel versions identified by the commit hash 80cd22c35c9001fe72bf614d29439de41933deca and likely other versions with similar code. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet. The root cause is a logic error in error code interpretation leading to a NULL pointer dereference in kernel space, which can be triggered remotely if an attacker can manipulate network traffic control filters, potentially causing system instability or denial of service.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running vulnerable Linux kernel versions, especially those leveraging advanced network traffic control features such as cls_flower filters. The impact is mainly a denial of service through kernel crashes, which can disrupt critical network infrastructure, servers, and cloud environments. Organizations relying on Linux-based routers, firewalls, or network appliances could experience outages or degraded service. Given the kernel-level nature of the vulnerability, exploitation could lead to system instability requiring reboots, impacting availability of services. Confidentiality and integrity impacts are limited as the vulnerability does not directly allow code execution or privilege escalation. However, disruption of network services can indirectly affect business operations, compliance requirements, and incident response capabilities. European sectors with high dependency on Linux infrastructure, such as telecommunications, finance, and government, may face operational risks. The absence of known exploits reduces immediate threat but does not eliminate the risk of future exploitation once the vulnerability is publicly known.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should prioritize updating their Linux kernel to a version where this issue is fixed. Since the vulnerability stems from a specific kernel commit, applying the latest stable kernel patches from trusted Linux distributions (e.g., Red Hat, Debian, Ubuntu) is essential. Network administrators should audit and restrict the use of advanced traffic control filters, especially cls_flower and related modules, limiting who can modify these configurations. Implement strict access controls and monitoring on systems managing network traffic control to detect anomalous changes. Employ kernel crash monitoring and automated recovery mechanisms to minimize downtime. For environments where immediate patching is not feasible, consider isolating vulnerable systems from untrusted networks or limiting network traffic control functionality. Engage with Linux vendor security advisories for timely updates and backported patches. Additionally, conduct thorough testing of network control configurations post-patching to ensure stability and functionality.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9832c4522896dcbe8a07

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

Last enriched: 6/30/2025, 9:57:42 AM

Last updated: 8/11/2025, 6:13:41 PM

Views: 11

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