CVE-2021-46904: net: hso: fix null-ptr-deref during tty device unregistration
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 getfreeserialindex() 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 getfreeserialindex() would return the same minor number.
Fix this by modifying getfreeserialindex to assign the minor number immediately after one is found to be and rename it to obtainminor() to better reflect what it does. Similary, rename setserialbyindex() to releaseminor() and modify it to free up the minor number of the given hsoserial. Every obtainminor() should have corresponding releaseminor() call.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2021-46904?
CVE-2021-46904 has a severity rating that may require attention due to potential null pointer dereference issues.
How do I fix CVE-2021-46904?
You can fix CVE-2021-46904 by upgrading to a patched version of the Linux kernel, specifically 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.119-1, 6.12.10-1, or 6.12.11-1.
Which Linux kernel versions are affected by CVE-2021-46904?
CVE-2021-46904 affects various Linux kernel versions between 2.6.27 and 5.11.0, specifically including versions up to 5.10.30.
What causes CVE-2021-46904?
CVE-2021-46904 is caused by multiple terminal devices attempting to use the same minor number, leading to a double unregistration scenario.
Is there a workaround for CVE-2021-46904?
While it is recommended to apply patches, a specific workaround for CVE-2021-46904 is not provided in the documentation.