CVE-2021-47068
net/nfc: fix use-after-free llcp_sock_bind/connect
Check your servers for CVE-2021-47068
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-47068 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
net/nfc: fix use-after-free llcp_sock_bind/connect
Commits 8a4cd82d ("nfc: fix refcount leak in llcp_sock_connect()") and c33b1cc62 ("nfc: fix refcount leak in llcp_sock_bind()") fixed a refcount leak bug in bind/connect but introduced a use-after-free if the same local is assigned to 2 different sockets.
This can be triggered by the following simple program: int sock1 = socket( AF_NFC, SOCK_STREAM, NFC_SOCKPROTO_LLCP ); int sock2 = socket( AF_NFC, SOCK_STREAM, NFC_SOCKPROTO_LLCP ); memset( &addr, 0, sizeof(struct sockaddr_nfc_llcp) ); addr.sa_family = AF_NFC; addr.nfc_protocol = NFC_PROTO_NFC_DEP; bind( sock1, (struct sockaddr*) &addr, sizeof(struct sockaddr_nfc_llcp) ) bind( sock2, (struct sockaddr*) &addr, sizeof(struct sockaddr_nfc_llcp) ) close(sock1); close(sock2);
Fix this by assigning NULL to llcp_sock->local after calling nfc_llcp_local_put.
This addresses CVE-2021-23134.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.23%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 15.1% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 22 Apr 2025):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Weakness
- CWE-416 Use After Free
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from a1cdd18c49d23ec38097ac2c5b0d761146fc0109, before 26157c82ba756767b2bd66d28a71b1bc454447f6 affected from 18013007b596771bf5f5e7feee9586fb0386ad14, before ccddad6dd28530e716448e594c9ca7c76ccd0570 affected from 538a6ff11516d38a61e237d2d2dc04c30c845fbe, before 18ae4a192a4496e48a5490b52812645d2413307c affected from adbb1d218c5f56dbae052765da83c0f57fce2a31, before 48fba458fe54cc2a980a05c13e6c19b8b2cfb610 affected from c89903c9eff219a4695e63715cf922748d743f65, before e32352070bcac22be6ed8ab635debc280bb65b8c affected from 6fb003e5ae18d8cda4c8a1175d9dd8db12bec049, before 6b7021ed36dabf29e56842e3408781cd3b82ef6e affected from 8c9e4971e142e2899606a2490b77a1208c1f4638, before 374cdde4dcc9c909a60713abdbbf96d5e3e09f91 affected from c33b1cc62ac05c1dbb1cdafe2eb66da01c76ca8d, before 18175fe17ae043a0b81e5d511f8817825784c299 affected from c33b1cc62ac05c1dbb1cdafe2eb66da01c76ca8d, before c61760e6940dd4039a7f5e84a6afc9cdbf4d82b6 affected from 4.4.267, before 4.4.269 affected from 4.9.267, before 4.9.269 affected from 4.14.231, before 4.14.233 affected from 4.19.187, before 4.19.191 affected from 5.4.112, before 5.4.119 affected from 5.10.30, before 5.10.37 affected from 5.11.14, before 5.11.21
Other versions: unaffected
|
| Linux |
affected 5.12 unaffected before 5.12 unaffected from 4.4.269 up to and including 4.4.* unaffected from 4.9.269 up to and including 4.9.* unaffected from 4.14.233 up to and including 4.14.* unaffected from 4.19.191 up to and including 4.19.* unaffected from 5.4.119 up to and including 5.4.* unaffected from 5.10.37 up to and including 5.10.* unaffected from 5.11.21 up to and including 5.11.* unaffected from 5.12.4 up to and including 5.12.* unaffected 5.13 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2021-47068 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2021-47068
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2021-47068
trivy image --scanners vuln IMAGE | grep CVE-2021-47068
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/26157c82ba756767b2bd66d28a71b1bc454447f6 git.kernel.org
- https://git.kernel.org/stable/c/ccddad6dd28530e716448e594c9ca7c76ccd0570 git.kernel.org
- https://git.kernel.org/stable/c/18ae4a192a4496e48a5490b52812645d2413307c git.kernel.org
- https://git.kernel.org/stable/c/48fba458fe54cc2a980a05c13e6c19b8b2cfb610 git.kernel.org
- https://git.kernel.org/stable/c/e32352070bcac22be6ed8ab635debc280bb65b8c git.kernel.org
- https://git.kernel.org/stable/c/6b7021ed36dabf29e56842e3408781cd3b82ef6e git.kernel.org
- https://git.kernel.org/stable/c/374cdde4dcc9c909a60713abdbbf96d5e3e09f91 git.kernel.org
- https://git.kernel.org/stable/c/18175fe17ae043a0b81e5d511f8817825784c299 git.kernel.org
- https://git.kernel.org/stable/c/c61760e6940dd4039a7f5e84a6afc9cdbf4d82b6 git.kernel.org
Source: the record CVE-2021-47068 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse