net: hso: fix null-ptr-deref during tty device unregistration
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 72dc1c096c7051a48ab1dbb12f71976656b55eb5 · < dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel hso driver can assign the same minor number to multiple tty devices. When those devices are unregistered, a second unregistration causes a null-pointer dereference. This requires the minor-number collision; the input does not specify an attack path or authentication requirements.
Engineers running Linux kernels with the hso driver should check their kernel version; affected versions are not specified.