CVE-2021-46904: net: hso: fix null-ptr-deref during tty device unregistration

Published Feb 25, 2024
·
Updated

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

8 affected componentsFixes available
Linux Linux kernel>=2.6.27<4.4.268
Linux Linux kernel>=4.5.0<4.9.268
Linux Linux kernel>=4.10.0<4.14.232
Linux Linux kernel>=4.15.0<4.19.187
Linux Linux kernel>=4.20.0<5.4.112
Linux Linux kernel>=5.5.0<5.10.30
Linux Linux kernel>=5.11.0<5.11.14
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.22-16.12.25-1

Event History

Feb 25, 2024
CVE Published
via MITRE·02:03 PM
Data Sourced
via MITRE·02:03 PM
Description
Aug 21, 2024
Data Sourced
via Launchpad·08:23 PM
Description
Apr 27, 2025
Data Sourced
via Ubuntu·12:13 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

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.

2

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.

3

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.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203