# CVE-2021-47139: net: hns3: put off calling register\_netdev() until client initialize complete

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.23% (percentile 8, 2026-11-28)
- **CWE:** CWE-908
- **Published:** 2024-03-25T09:07:38.216Z
- **Modified:** 2026-06-17T04:16:37.893Z

## Who should check

- Anyone running Linux \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< a663c1e418a3b5b8e8edfad4bc8e7278c312d6fc; \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< 0921a0620b5077796fddffb22a8e6bc635a4bb50; \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< a289a7e5c1d49b7d47df9913c1cc81fb48fab613
- Anyone running Linux 5.6

## Description

In the Linux kernel, the following vulnerability has been resolved:

net: hns3: put off calling register\_netdev() until client initialize complete

Currently, the netdevice is registered before client initializing
complete. So there is a timewindow between netdevice available
and usable. In this case, if user try to change the channel number
or ring param, it may cause the hns3\_set\_rx\_cpu\_rmap() being called
twice, and report bug.

\[47199.416502\] hns3 0000:35:00.0 eth1: set channels: tqp\_num=1, rxfh=0
\[47199.430340\] hns3 0000:35:00.0 eth1: already uninitialized
\[47199.438554\] hns3 0000:35:00.0: rss changes from 4 to 1
\[47199.511854\] hns3 0000:35:00.0: Channels changed, rss\_size from 4 to 1, tqps from 4 to 1
\[47200.163524\] ------------\[ cut here \]------------
\[47200.171674\] kernel BUG at lib/cpu\_rmap.c:142!
\[47200.177847\] Internal error: Oops - BUG: 0 \[\#1\] PREEMPT SMP
\[47200.185259\] Modules linked in: hclge(+) hns3(-) hns3\_cae(O) hns\_roce\_hw\_v2 hnae3 vfio\_iommu\_type1 vfio\_pci vfio\_virqfd vfio pv680\_mii(O) \[last unloaded: hclge\]
\[47200.205912\] CPU: 1 PID: 8260 Comm: ethtool Tainted: G           O      5.11.0-rc3+ \#1
\[47200.215601\] Hardware name:  , xxxxxx 02/04/2021
\[47200.223052\] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
\[47200.230188\] pc : cpu\_rmap\_add+0x38/0x40
\[47200.237472\] lr : irq\_cpu\_rmap\_add+0x84/0x140
\[47200.243291\] sp : ffff800010e93a30
\[47200.247295\] x29: ffff800010e93a30 x28: ffff082100584880
\[47200.254155\] x27: 0000000000000000 x26: 0000000000000000
\[47200.260712\] x25: 0000000000000000 x24: 0000000000000004
\[47200.267241\] x23: ffff08209ba03000 x22: ffff08209ba038c0
\[47200.273789\] x21: 000000000000003f x20: ffff0820e2bc1680
\[47200.280400\] x19: ffff0820c970ec80 x18: 00000000000000c0
\[47200.286944\] x17: 0000000000000000 x16: ffffb43debe4a0d0
\[47200.293456\] x15: fffffc2082990600 x14: dead000000000122
\[47200.300059\] x13: ffffffffffffffff x12: 000000000000003e
\[47200.306606\] x11: ffff0820815b8080 x10: ffff53e411988000
\[47200.313171\] x9 : 0000000000000000 x8 : ffff0820e2bc1700
\[47200.319682\] x7 : 0000000000000000 x6 : 000000000000003f
\[47200.326170\] x5 : 0000000000000040 x4 : ffff800010e93a20
\[47200.332656\] x3 : 0000000000000004 x2 : ffff0820c970ec80
\[47200.339168\] x1 : ffff0820e2bc1680 x0 : 0000000000000004
\[47200.346058\] Call trace:
\[47200.349324\]  cpu\_rmap\_add+0x38/0x40
\[47200.354300\]  hns3\_set\_rx\_cpu\_rmap+0x6c/0xe0 \[hns3\]
\[47200.362294\]  hns3\_reset\_notify\_init\_enet+0x1cc/0x340 \[hns3\]
\[47200.370049\]  hns3\_change\_channels+0x40/0xb0 \[hns3\]
\[47200.376770\]  hns3\_set\_channels+0x12c/0x2a0 \[hns3\]
\[47200.383353\]  ethtool\_set\_channels+0x140/0x250
\[47200.389772\]  dev\_ethtool+0x714/0x23d0
\[47200.394440\]  dev\_ioctl+0x4cc/0x640
\[47200.399277\]  sock\_do\_ioctl+0x100/0x2a0
\[47200.404574\]  sock\_ioctl+0x28c/0x470
\[47200.409079\]  \_\_arm64\_sys\_ioctl+0xb4/0x100
\[47200.415217\]  el0\_svc\_common.constprop.0+0x84/0x210
\[47200.422088\]  do\_el0\_svc+0x28/0x34
\[47200.426387\]  el0\_svc+0x28/0x70
\[47200.431308\]  el0\_sync\_handler+0x1a4/0x1b0
\[47200.436477\]  el0\_sync+0x174/0x180
\[47200.441562\] Code: 11000405 79000c45 f8247861 d65f03c0 (d4210000)
\[47200.448869\] ---\[ end trace a01efe4ce42e5f34 \]---

The process is like below:
excuting hns3\_client\_init
\|
register\_netdev()
\|                           hns3\_set\_channels()
\|                           \|
hns3\_set\_rx\_cpu\_rmap()      hns3\_reset\_notify\_uninit\_enet()
\|                               \|
\|                            quit without calling function
\|                            hns3\_free\_rx\_cpu\_rmap for flag
\|                            HNS3\_NIC\_STATE\_INITED is unset.
\|                           \|
\|                           hns3\_reset\_notify\_init\_enet()
\|                               \|
set HNS3\_NIC\_STATE\_INITED    call hns3\_set\_rx\_cpu\_rmap()-- crash

Fix it by calling register\_netdev() at the end of function
hns3\_client\_init().

## Affected and fixed versions

- Linux: \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< a663c1e418a3b5b8e8edfad4bc8e7278c312d6fc; \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< 0921a0620b5077796fddffb22a8e6bc635a4bb50; \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< a289a7e5c1d49b7d47df9913c1cc81fb48fab613 (cvelist)
- Linux: 5.6 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47139.md
Affected: Linux >= 08a100689d4baf296d6898c687ea8d005da8d234, < a663c1e418a3b5b8e8edfad4bc8e7278c312d6fc; >= 08a100689d4baf296d6898c687ea8d005da8d234, < 0921a0620b5077796fddffb22a8e6bc635a4bb50; >= 08a100689d4baf296d6898c687ea8d005da8d234, < a289a7e5c1d49b7d47df9913c1cc81fb48fab613; Linux 5.6
Fixed in: Linux 0921a0620b5077796fddffb22a8e6bc635a4bb50

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-47139 being exploited?

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< a663c1e418a3b5b8e8edfad4bc8e7278c312d6fc; \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< 0921a0620b5077796fddffb22a8e6bc635a4bb50; \>= 08a100689d4baf296d6898c687ea8d005da8d234, \< a289a7e5c1d49b7d47df9913c1cc81fb48fab613; Linux 5.6.

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

Yes. Fixed in Linux 0921a0620b5077796fddffb22a8e6bc635a4bb50. No fix listed yet: follow the vendor advisory.

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

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/a663c1e418a3b5b8e8edfad4bc8e7278c312d6fc>
- patch: <https://git.kernel.org/stable/c/0921a0620b5077796fddffb22a8e6bc635a4bb50>
- patch: <https://git.kernel.org/stable/c/a289a7e5c1d49b7d47df9913c1cc81fb48fab613>

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

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