diff options
| author | Johan Hovold <johan@kernel.org> | 2026-09-30 15:18:45 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-10-01 11:05:17 +0200 |
| commit | 8df07fe93573e9e548d6645273e9bcb6eb74059e (patch) | |
| tree | fc212e82f862627f6fccc39d07231d0ef12f7dc6 /net | |
| parent | 8167c1f071426706c233e93ecfd13aba7d5c06c8 (diff) | |
| download | linux-stable-8df07fe93573e9e548d6645273e9bcb6eb74059e.tar.gz linux-stable-8df07fe93573e9e548d6645273e9bcb6eb74059e.zip | |
tty: fix saved termios reset race
Resetting saved termios state on device registration is needed where a
minor number can be reused for an entirely different device and where
the old settings may prevent the port from even being opened (e.g. when
CLOCAL is not set).
Not all TTY drivers guarantee that the minor number is no longer in use
when registering devices however, something which can lead to a
use-after-free when closing a TTY (and saving its termios) races with
re-registration.
Add a new TTY_DRIVER_RESET_SAVED_TERMIOS flag to request that any saved
termios state is reset on registration and only set it for drivers that
make sure that the minor number is no longer in use.
Fixes: 93857edd9829 ("tty: reset termios state on device registration")
Reported-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Link: https://lore.kernel.org/20260926184154.3017929-1-nicoyip.dev@gmail.com
Cc: stable@kernel.org # 4.12
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260930131845.1809256-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions
