Skip to contentSkip to conversation

CVE-2026-98752: tty: port: fix tty_port_tty_vhangup() race

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 18

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

tty: port: fix tty_port_tty_vhangup() race

Drivers rely on tty_port_tty_vhangup() to synchronously hang up their ports before tearing down resources as part of deregistration (e.g. on physical disconnect).

If tty_port_tty_vhangup() races with another hangup it may however return before the port has been shut down. This is in turn can lead to use-after-free and NULL-pointer dereferences in racing ioctls (including a synchronous hangup) and in processing of racing asynchronous hangups (carrier loss).

Add the missing serialisation to tty_port_tty_vhangup() and tty_port_hangup() so that the former does not return until the port has been shut down also when there is a racing hangup.

Note that serial core does not use tty_port_hangup(), but it already holds the port mutex when clearing port->tty and shutting down the port in uart_hangup().

The Linux kernel CVE team has assigned CVE-2026-98752 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 2.6.32 with commit 7ca0ff9ab3218ec443a7a9ad247e4650373ed41e and fixed in 6.12.113 with commit 6d1a984afc3ca477dab3e51ec806671d443ad524
	Issue introduced in 2.6.32 with commit 7ca0ff9ab3218ec443a7a9ad247e4650373ed41e and fixed in 6.18.56 with commit 6b7be3b9b857947e9c1338d4919d4ebd3b75e907
	Issue introduced in 2.6.32 with commit 7ca0ff9ab3218ec443a7a9ad247e4650373ed41e and fixed in 7.2.10 with commit 017b18addbe8dcace1a569a00d40ed1ba1e03f4c
	Issue introduced in 2.6.32 with commit 7ca0ff9ab3218ec443a7a9ad247e4650373ed41e and fixed in 7.3-rc6 with commit b48820de8c1a596c5b99775524dfce73c6576c5d
	Issue introduced in 2.6.31.2 with commit 4260dc792fabfd20c8644fa9414b2ae48372365f

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-98752

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/tty/tty_port.c
include/linux/tty_port.h

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/6d1a984afc3ca477dab3e51ec806671d443ad524
	https://git.kernel.org/stable/c/6b7be3b9b857947e9c1338d4919d4ebd3b75e907
	https://git.kernel.org/stable/c/017b18addbe8dcace1a569a00d40ed1ba1e03f4c
	https://git.kernel.org/stable/c/b48820de8c1a596c5b99775524dfce73c6576c5d