# CVE-2021-47400: net: hns3: do not allow call hns3\_nic\_net\_open repeatedly

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.34% (percentile 20, 2026-11-26)
- **Published:** 2024-05-21T15:03:55.368Z
- **Modified:** 2026-08-05T08:47:40.000Z

## Who should check

- Anyone running Linux \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 5a31d4e73ada8022427b69b10fd1f01a6a8d4b3d; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< f8ba689cb69523144d10606096ef686002dd7285; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 3dac38bdce7932901b9f0b71c62331852c809e61; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 5b09e88e1bf7fe86540fab4b5f3eece8abead39e
- Anyone running Linux 5.0

## 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.

## Affected and fixed versions

- Linux: \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 5a31d4e73ada8022427b69b10fd1f01a6a8d4b3d; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< f8ba689cb69523144d10606096ef686002dd7285; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 3dac38bdce7932901b9f0b71c62331852c809e61; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 5b09e88e1bf7fe86540fab4b5f3eece8abead39e (cvelist)
- Linux: 5.0 (cvelist)

## Mitigation

- Upgrade Linux to 5b09e88e1bf7fe86540fab4b5f3eece8abead39e or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47400. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47400.md
Affected: Linux >= e888402789b9db5de4fcda361331d66dbf0cd9fd, < 5a31d4e73ada8022427b69b10fd1f01a6a8d4b3d; >= e888402789b9db5de4fcda361331d66dbf0cd9fd, < f8ba689cb69523144d10606096ef686002dd7285; >= e888402789b9db5de4fcda361331d66dbf0cd9fd, < 3dac38bdce7932901b9f0b71c62331852c809e61; >= e888402789b9db5de4fcda3…
Fixed in: Linux 5a31d4e73ada8022427b69b10fd1f01a6a8d4b3d, Linux 3dac38bdce7932901b9f0b71c62331852c809e61, Linux 5b09e88e1bf7fe86540fab4b5f3eece8abead39e

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47400 being exploited?

There is no confirmed exploitation: CVE-2021-47400 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47400?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-47400?

Linux \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 5a31d4e73ada8022427b69b10fd1f01a6a8d4b3d; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< f8ba689cb69523144d10606096ef686002dd7285; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 3dac38bdce7932901b9f0b71c62331852c809e61; \>= e888402789b9db5de4fcda361331d66dbf0cd9fd, \< 5b09e88e1bf7fe86540fab4b5f3eece8abead39e; Linux 5.0.

### Is there a fix for CVE-2021-47400?

Yes. Fixed in Linux 5a31d4e73ada8022427b69b10fd1f01a6a8d4b3d, Linux 3dac38bdce7932901b9f0b71c62331852c809e61, Linux 5b09e88e1bf7fe86540fab4b5f3eece8abead39e. Upgrade Linux to 5b09e88e1bf7fe86540fab4b5f3eece8abead39e or later.

### How do I check if I'm affected by CVE-2021-47400?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/5a31d4e73ada8022427b69b10fd1f01a6a8d4b3d>
- patch: <https://git.kernel.org/stable/c/f8ba689cb69523144d10606096ef686002dd7285>
- patch: <https://git.kernel.org/stable/c/3dac38bdce7932901b9f0b71c62331852c809e61>
- patch: <https://git.kernel.org/stable/c/5b09e88e1bf7fe86540fab4b5f3eece8abead39e>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47400>

HTML: <https://flawdb.com/CVE-2021-47400> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47400>
