# CVE-2021-47555: net: vlan: fix underflow for the real\_dev refcnt

- Priority: **Routine**
- Reason: Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-05-24 · Modified: 2026-08-05
- Aliases: UBUNTU-CVE-2021-47555, DEBIAN-CVE-2021-47555
- Record: https://cvemate.com/vulnerability/CVE-2021-47555 · JSON: https://cvemate.com/vulnerability/CVE-2021-47555/json

## Description

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

net: vlan: fix underflow for the real_dev refcnt

Inject error before dev_hold(real_dev) in register_vlan_dev(),
and execute the following testcase:

ip link add dev dummy1 type dummy
ip link add name dummy1.100 link dummy1 type vlan id 100
ip link del dev dummy1

When the dummy netdevice is removed, we will get a WARNING as following:

=======================================================================
refcount_t: decrement hit 0; leaking memory.
WARNING: CPU: 2 PID: 0 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0

and an endless loop of:

=======================================================================
unregister_netdevice: waiting for dummy1 to become free. Usage count = -1073741824

That is because dev_put(real_dev) in vlan_dev_free() be called without
dev_hold(real_dev) in register_vlan_dev(). It makes the refcnt of real_dev
underflow.

Move the dev_hold(real_dev) to vlan_dev_init() which is the call-back of
ndo_init(). That makes dev_hold() and dev_put() for vlan's real_dev
symmetrical.
```

## Signals

- CVSS: 7.8 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.221%, percentile 13.406%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 84)

- debian linux (Debian): \< 5.15.15-1
- ubuntu linux (Ubuntu): \< 5.4.0-100.113
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 5.4.0-1066.69
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1066.69~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1070.73
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.4 (Ubuntu): \< 5.4.0-1070.73~18.04.1
- ubuntu linux-azure-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-6.2 (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/5e44178864b38dd70b877985abd7d86fdb95f27d>
- <https://git.kernel.org/stable/c/6e800ee43218a56acc93676bbb3d93b74779e555>
- <https://git.kernel.org/stable/c/f7fc72a508cf115c273a7a29350069def1041890>
- <https://git.kernel.org/stable/c/01d9cc2dea3fde3bad6d27f464eff463496e2b00>
- <https://ubuntu.com/security/CVE-2021-47555>
- <https://www.cve.org/CVERecord?id=CVE-2021-47555>
- <https://git.kernel.org/linus/01d9cc2dea3fde3bad6d27f464eff463496e2b00>
- <https://security-tracker.debian.org/tracker/CVE-2021-47555>

---

Data as of 2026-12-05T18:29:32.442Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
