5.5medium
net: hso: fix null-ptr-deref during tty device unregistration
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.26% (higher than 18% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before a462067d7c8e6953a733bf5ade8db947b1bb5449, from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before 145c89c441d27696961752bf51b323f347601bee, from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before caf5ac93b3b5d5fac032fc11fbea680e115421b4, from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before 92028d7a31e55d53e41cff679156b9432cffcb36, from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before 4a2933c88399c0ebc738db39bbce3ae89786d723, from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac, from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before 388d05f70f1ee0cac4a2068fd295072f1a44152a, from 72dc1c096c7051a48ab1dbb12f71976656b55eb5 before 8a12f8836145ffe37e9c8733dce18c22fb668b66 and 1 more Not affected: before 2.6.27, from 4.4.268 up to 4.4.*, from 4.9.268 up to 4.9.*, from 4.14.232 up to 4.14.*, from 4.19.187 up to 4.19.*, from 5.4.112 up to 5.4.* | CVE List |
| linux linux_kernel | from 2.6.27 before 4.4.268, from 4.5.0 before 4.9.268, from 4.10.0 before 4.14.232, from 4.15.0 before 4.19.187, from 4.20.0 before 5.4.112, from 5.5.0 before 5.10.30, from 5.11.0 before 5.11.14 | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
NVD (es)
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: net: hso: corrige null-ptr-deref durante la cancelación del registro del dispositivo tty. Múltiples ttys intentan reclamar el mismo número menor, lo que provoca una doble cancelación del registro del mismo dispositivo. La primera cancelación del registro se realiza correctamente, pero la siguiente genera un null-ptr-deref. La función get_free_serial_index() devuelve un número menor disponible pero no lo asigna inmediatamente. La asignación la realiza la persona que llama más tarde. Pero antes de esta asignación, las llamadas a get_free_serial_index() devolverían el mismo número menor. Solucione este problema modificando get_free_serial_index para asignar el número menor inmediatamente después de que se encuentre uno y cámbiele el nombre a get_minor() para reflejar mejor lo que hace. De manera similar, cambie el nombre de set_serial_by_index() a release_minor() y modifíquelo para liberar el número menor del hso_serial dado. Cada get_minor() debe tener la llamada release_minor() correspondiente.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-46904 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2021-46904 changed 2026-06-17 | Public domain |