CVE-2021-46904
net: hso: fix null-ptr-deref during tty device unregistration
Check your servers for CVE-2021-46904
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-46904 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: hso: fix null-ptr-deref during tty device unregistration
Multiple ttys try to claim the same the minor number causing a double unregistration of the same device. The first unregistration succeeds but the next one results in a null-ptr-deref.
The get_free_serial_index() function returns an available minor number but doesn't assign it immediately. The assignment is done by the caller later. But before this assignment, calls to get_free_serial_index() would return the same minor number.
Fix this by modifying get_free_serial_index to assign the minor number immediately after one is found to be and rename it to obtain_minor() to better reflect what it does. Similary, rename set_serial_by_index() to release_minor() and modify it to free up the minor number of the given hso_serial. Every obtain_minor() should have corresponding release_minor() call.
Exploitation
EPSS 0.26%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 18.3% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 25 Jul 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before a462067d7c8e6953a733bf5ade8db947b1bb5449 affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before 145c89c441d27696961752bf51b323f347601bee affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before caf5ac93b3b5d5fac032fc11fbea680e115421b4 affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before 92028d7a31e55d53e41cff679156b9432cffcb36 affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before 4a2933c88399c0ebc738db39bbce3ae89786d723 affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before 388d05f70f1ee0cac4a2068fd295072f1a44152a affected from 72dc1c096c7051a48ab1dbb12f71976656b55eb5, before 8a12f8836145ffe37e9c8733dce18c22fb668b66
Other versions: unaffected
|
| Linux |
affected 2.6.27 unaffected before 2.6.27 unaffected from 4.4.268 up to and including 4.4.* unaffected from 4.9.268 up to and including 4.9.* unaffected from 4.14.232 up to and including 4.14.* unaffected from 4.19.187 up to and including 4.19.* unaffected from 5.4.112 up to and including 5.4.* unaffected from 5.10.30 up to and including 5.10.* unaffected from 5.11.14 up to and including 5.11.* unaffected 5.12 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-46904 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2021-46904
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-46904
trivy image --scanners vuln IMAGE | grep CVE-2021-46904
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/a462067d7c8e6953a733bf5ade8db947b1bb5449 git.kernel.org
- https://git.kernel.org/stable/c/145c89c441d27696961752bf51b323f347601bee git.kernel.org
- https://git.kernel.org/stable/c/caf5ac93b3b5d5fac032fc11fbea680e115421b4 git.kernel.org
- https://git.kernel.org/stable/c/92028d7a31e55d53e41cff679156b9432cffcb36 git.kernel.org
- https://git.kernel.org/stable/c/4a2933c88399c0ebc738db39bbce3ae89786d723 git.kernel.org
- https://git.kernel.org/stable/c/dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac git.kernel.org
- https://git.kernel.org/stable/c/388d05f70f1ee0cac4a2068fd295072f1a44152a git.kernel.org
- https://git.kernel.org/stable/c/8a12f8836145ffe37e9c8733dce18c22fb668b66 git.kernel.org
Source: the record CVE-2021-46904 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse