Skip to main content

CVE-2021-47400: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2021-47400cvecve-2021-47400
Published: Tue May 21 2024 (05/21/2024, 15:03:55 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: hns3: do not allow call hns3_nic_net_open repeatedly hns3_nic_net_open() is not allowed to called repeatly, but there is no checking for this. When doing device reset and setup tc concurrently, there is a small oppotunity to call hns3_nic_net_open repeatedly, and cause kernel bug by calling napi_enable twice. The calltrace information is like below: [ 3078.222780] ------------[ cut here ]------------ [ 3078.230255] kernel BUG at net/core/dev.c:6991! [ 3078.236224] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 3078.243431] Modules linked in: hns3 hclgevf hclge hnae3 vfio_iommu_type1 vfio_pci vfio_virqfd vfio pv680_mii(O) [ 3078.258880] CPU: 0 PID: 295 Comm: kworker/u8:5 Tainted: G O 5.14.0-rc4+ #1 [ 3078.269102] Hardware name: , BIOS KpxxxFPGA 1P B600 V181 08/12/2021 [ 3078.276801] Workqueue: hclge hclge_service_task [hclge] [ 3078.288774] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 3078.296168] pc : napi_enable+0x80/0x84 tc qdisc sho[w 3d0e7v8 .e3t0h218 79] lr : hns3_nic_net_open+0x138/0x510 [hns3] [ 3078.314771] sp : ffff8000108abb20 [ 3078.319099] x29: ffff8000108abb20 x28: 0000000000000000 x27: ffff0820a8490300 [ 3078.329121] x26: 0000000000000001 x25: ffff08209cfc6200 x24: 0000000000000000 [ 3078.339044] x23: ffff0820a8490300 x22: ffff08209cd76000 x21: ffff0820abfe3880 [ 3078.349018] x20: 0000000000000000 x19: ffff08209cd76900 x18: 0000000000000000 [ 3078.358620] x17: 0000000000000000 x16: ffffc816e1727a50 x15: 0000ffff8f4ff930 [ 3078.368895] x14: 0000000000000000 x13: 0000000000000000 x12: 0000259e9dbeb6b4 [ 3078.377987] x11: 0096a8f7e764eb40 x10: 634615ad28d3eab5 x9 : ffffc816ad8885b8 [ 3078.387091] x8 : ffff08209cfc6fb8 x7 : ffff0820ac0da058 x6 : ffff0820a8490344 [ 3078.396356] x5 : 0000000000000140 x4 : 0000000000000003 x3 : ffff08209cd76938 [ 3078.405365] x2 : 0000000000000000 x1 : 0000000000000010 x0 : ffff0820abfe38a0 [ 3078.414657] Call trace: [ 3078.418517] napi_enable+0x80/0x84 [ 3078.424626] hns3_reset_notify_up_enet+0x78/0xd0 [hns3] [ 3078.433469] hns3_reset_notify+0x64/0x80 [hns3] [ 3078.441430] hclge_notify_client+0x68/0xb0 [hclge] [ 3078.450511] hclge_reset_rebuild+0x524/0x884 [hclge] [ 3078.458879] hclge_reset_service_task+0x3c4/0x680 [hclge] [ 3078.467470] hclge_service_task+0xb0/0xb54 [hclge] [ 3078.475675] process_one_work+0x1dc/0x48c [ 3078.481888] worker_thread+0x15c/0x464 [ 3078.487104] kthread+0x160/0x170 [ 3078.492479] ret_from_fork+0x10/0x18 [ 3078.498785] Code: c8027c81 35ffffa2 d50323bf d65f03c0 (d4210000) [ 3078.506889] ---[ end trace 8ebe0340a1b0fb44 ]--- Once hns3_nic_net_open() is excute success, the flag HNS3_NIC_STATE_DOWN will be cleared. So add checking for this flag, directly return when HNS3_NIC_STATE_DOWN is no set.

AI-Powered Analysis

AILast updated: 06/30/2025, 12:26:23 UTC

Technical Analysis

CVE-2021-47400 is a medium-severity vulnerability in the Linux kernel's hns3 network driver, specifically related to the function hns3_nic_net_open(). The vulnerability arises because the function hns3_nic_net_open() can be called repeatedly without proper checks, which is not the intended behavior. This occurs during concurrent device reset and traffic control (tc) setup operations, creating a race condition that allows hns3_nic_net_open() to be invoked multiple times. The root cause is the lack of verification of the HNS3_NIC_STATE_DOWN flag before executing the function, leading to a kernel bug triggered by calling napi_enable() twice. The kernel bug manifests as a kernel panic or BUG error, causing the affected system to crash or become unstable. The call trace provided shows the kernel panic occurs at net/core/dev.c:6991, with the stack trace involving the hns3 and hclge modules. This vulnerability affects Linux kernel versions containing the hns3 driver, which is used for certain network interface cards (NICs), particularly those from Huawei's HiSilicon. The vulnerability does not impact confidentiality or integrity but affects availability by causing kernel crashes. Exploitation requires local access with the ability to trigger device reset and tc setup concurrently, and no user interaction or privileges beyond local access are needed. No known exploits are reported in the wild, and a patch involves adding a check for the HNS3_NIC_STATE_DOWN flag to prevent repeated calls to hns3_nic_net_open(). The CVSS v3.1 score is 4.0, reflecting low complexity but limited impact scope.

Potential Impact

For European organizations, the primary impact of CVE-2021-47400 is on system availability and stability. Organizations using Linux servers or network devices with the hns3 driver, especially those employing Huawei HiSilicon NICs, may experience unexpected kernel panics leading to service disruptions. This can affect critical infrastructure, data centers, and cloud providers relying on these network interfaces. Although the vulnerability does not expose data confidentiality or integrity, repeated crashes can cause downtime, impacting business continuity and operational reliability. In sectors such as telecommunications, finance, and government, where high availability is crucial, this vulnerability could lead to significant operational challenges. Additionally, the need for local access to trigger the vulnerability limits remote exploitation risk but does not eliminate insider threat or attacker lateral movement scenarios. The absence of known exploits in the wild reduces immediate risk but patching is recommended to prevent potential future exploitation and maintain system stability.

Mitigation Recommendations

1. Apply the official Linux kernel patches that address CVE-2021-47400 as soon as they become available from trusted sources or Linux distributions. 2. For systems using Huawei HiSilicon NICs with the hns3 driver, verify the driver version and update to a patched kernel version. 3. Implement strict access controls to limit local user privileges and prevent unauthorized users from triggering device resets or tc setups. 4. Monitor kernel logs for signs of repeated hns3_nic_net_open() calls or kernel BUG messages related to net/core/dev.c to detect potential exploitation attempts or instability. 5. In virtualized or containerized environments, isolate network device management to reduce the risk of concurrent operations triggering the vulnerability. 6. Coordinate with hardware vendors and Linux distribution maintainers to ensure timely updates and compatibility testing. 7. Consider temporary workarounds such as disabling or unloading the hns3 driver if feasible and if network functionality is not critical, until patches are applied.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T14:58:30.816Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9833c4522896dcbe9007

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

Last enriched: 6/30/2025, 12:26:23 PM

Last updated: 8/16/2025, 1:47:10 AM

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