Skip to main content

CVE-2025-21921: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2025-21921cvecve-2025-21921
Published: Tue Apr 01 2025 (04/01/2025, 15:40:55 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device ethnl_req_get_phydev() is used to lookup a phy_device, in the case an ethtool netlink command targets a specific phydev within a netdev's topology. It takes as a parameter a const struct nlattr *header that's used for error handling : if (!phydev) { NL_SET_ERR_MSG_ATTR(extack, header, "no phy matching phyindex"); return ERR_PTR(-ENODEV); } In the notify path after a ->set operation however, there's no request attributes available. The typical callsite for the above function looks like: phydev = ethnl_req_get_phydev(req_base, tb[ETHTOOL_A_XXX_HEADER], info->extack); So, when tb is NULL (such as in the ethnl notify path), we have a nice crash. It turns out that there's only the PLCA command that is in that case, as the other phydev-specific commands don't have a notification. This commit fixes the crash by passing the cmd index and the nlattr array separately, allowing NULL-checking it directly inside the helper.

AI-Powered Analysis

AILast updated: 06/30/2025, 10:42:27 UTC

Technical Analysis

CVE-2025-21921 is a vulnerability identified in the Linux kernel's networking subsystem, specifically within the ethtool netlink interface used for managing PHY devices (physical layer devices) associated with network interfaces. The vulnerability arises from improper handling of NULL netlink attributes (nlattrs) when retrieving a phy_device in the function ethnl_req_get_phydev(). This function expects a non-NULL nlattr pointer for error handling during phy_device lookup. However, in the notification path following a set operation, the request attributes can be NULL, particularly for the PLCA (Physical Layer Collision Avoidance) command, which is unique in this behavior. When the nlattr array is NULL, the function attempts to dereference it, causing a kernel crash (denial of service). The root cause is that the code does not perform a NULL check on the nlattr pointer before usage in this specific notification context. The fix involves modifying the function call to pass the command index and the nlattr array separately, allowing the function to check for NULL and avoid dereferencing it, thereby preventing the crash. This vulnerability does not appear to have known exploits in the wild yet and affects specific Linux kernel versions identified by commit hashes. The vulnerability is a kernel crash triggered by malformed or unexpected netlink messages targeting PHY devices via ethtool, which can be exploited by an attacker with the ability to send crafted netlink messages to the kernel's networking subsystem.

Potential Impact

For European organizations, this vulnerability poses a risk primarily in environments where Linux servers or network devices running vulnerable kernel versions are deployed, especially in data centers, cloud infrastructure, and network equipment that rely on ethtool for PHY device management. Exploitation leads to a kernel crash, resulting in denial of service (DoS), which can disrupt critical network services and impact availability. While it does not directly lead to privilege escalation or data leakage, the DoS can cause operational downtime, affecting business continuity and service level agreements. Organizations with high availability requirements or those operating critical infrastructure could face significant operational impacts. Additionally, if exploited in multi-tenant environments such as cloud providers or hosting services, it could affect multiple customers. Since the vulnerability requires sending crafted netlink messages, an attacker would need local or network-level access to the affected system's netlink interface, which may limit remote exploitation but does not eliminate risk in exposed or poorly segmented networks.

Mitigation Recommendations

1. Apply the official Linux kernel patches that address CVE-2025-21921 as soon as they become available from trusted sources or Linux distributions. 2. For environments where immediate patching is not feasible, restrict access to the netlink interface used by ethtool to trusted users and processes only, minimizing the attack surface. 3. Implement network segmentation and firewall rules to limit access to management interfaces and prevent untrusted users from sending netlink messages. 4. Monitor system logs and kernel messages for unusual netlink activity or crashes related to ethtool operations to detect potential exploitation attempts. 5. In virtualized or containerized environments, ensure that guest systems cannot send arbitrary netlink messages that could impact the host kernel. 6. Incorporate this vulnerability into vulnerability management and incident response plans to ensure rapid detection and remediation. 7. Educate system administrators about the risks of allowing untrusted users to interact with kernel netlink interfaces and enforce the principle of least privilege.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9833c4522896dcbe8be5

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

Last enriched: 6/30/2025, 10:42:27 AM

Last updated: 7/27/2025, 4:12:29 PM

Views: 12

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