CVE-2021-47555
Severity CVSS v4.0:
Pending analysis
Type:
CWE-191
Integer Underflow (Wrap or Wraparound)
Publication date:
24/05/2024
Last modified:
18/09/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
net: vlan: fix underflow for the real_dev refcnt<br />
<br />
Inject error before dev_hold(real_dev) in register_vlan_dev(),<br />
and execute the following testcase:<br />
<br />
ip link add dev dummy1 type dummy<br />
ip link add name dummy1.100 link dummy1 type vlan id 100<br />
ip link del dev dummy1<br />
<br />
When the dummy netdevice is removed, we will get a WARNING as following:<br />
<br />
=======================================================================<br />
refcount_t: decrement hit 0; leaking memory.<br />
WARNING: CPU: 2 PID: 0 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0<br />
<br />
and an endless loop of:<br />
<br />
=======================================================================<br />
unregister_netdevice: waiting for dummy1 to become free. Usage count = -1073741824<br />
<br />
That is because dev_put(real_dev) in vlan_dev_free() be called without<br />
dev_hold(real_dev) in register_vlan_dev(). It makes the refcnt of real_dev<br />
underflow.<br />
<br />
Move the dev_hold(real_dev) to vlan_dev_init() which is the call-back of<br />
ndo_init(). That makes dev_hold() and dev_put() for vlan&#39;s real_dev<br />
symmetrical.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.4.160 (including) | 5.4.163 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.10.80 (including) | 5.10.83 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.14.19 (including) | 5.15 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.15.3 (including) | 5.15.6 (excluding) |
cpe:2.3:o:linux:linux_kernel:5.16:rc1:*:*:*:*:*:* | ||
cpe:2.3:o:linux:linux_kernel:5.16:rc2:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/01d9cc2dea3fde3bad6d27f464eff463496e2b00
- 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://git.kernel.org/stable/c/5e44178864b38dd70b877985abd7d86fdb95f27d
- https://git.kernel.org/stable/c/6e800ee43218a56acc93676bbb3d93b74779e555
- https://git.kernel.org/stable/c/f7fc72a508cf115c273a7a29350069def1041890