linux/drivers/staging/greybus
Johan Hovold 8df07fe935 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: 93857edd98 ("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>
History 2026-10-01 11:05:17 +02:00
..
Documentation staging: greybus: fix typo in sysfs-bus-greybus 2026-05-04 16:17:55 +02:00
arche-apb-ctrl.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
arche-platform.c staging: greybus: arche-platform: Use sysfs_emit instead of sprintf 2026-03-09 17:02:34 +01:00
arche_platform.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_apbridgea.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
audio_apbridgea.h greybus: audio: apbridgea: Remove flexible array from struct audio_apbridgea_hdr 2024-03-05 13:59:14 +00:00
audio_codec.c staging: greybus: audio_codec: remove redundant else-if check 2026-07-07 11:19:05 +02:00
audio_codec.h greybus: audio: Split gb_audio_gb_get_topology() into size query and data fetch 2026-07-28 09:24:56 +02:00
audio_gb.c greybus: audio: Split gb_audio_gb_get_topology() into size query and data fetch 2026-07-28 09:24:56 +02:00
audio_helper.c ASoC: audio_helper: convert to snd_soc_dapm_xxx() 2025-11-17 00:14:22 +00:00
audio_helper.h staging: greybus: audio: Add helper APIs for dynamic audio modules 2020-07-29 16:40:09 +02:00
audio_manager.c staging: greybus: audio: remove unused gb_audio_manager_get_module() 2026-02-25 07:04:51 -08:00
audio_manager.h staging: greybus: audio: remove unused gb_audio_manager_get_module() 2026-02-25 07:04:51 -08:00
audio_manager_module.c staging: greybus: audio: drop stale TODO comment 2026-02-25 07:05:07 -08:00
audio_manager_private.h staging: greybus: Modify lines end with a '(' 2023-10-17 15:42:27 +02:00
audio_manager_sysfs.c staging: greybus: audio: correct sscanf() return value check 2026-07-07 11:17:41 +02:00
audio_module.c greybus: audio: Split gb_audio_gb_get_topology() into size query and data fetch 2026-07-28 09:24:56 +02:00
audio_topology.c ASoC: audio_topology: convert to snd_soc_dapm_xxx() 2025-11-17 00:14:23 +00:00
authentication.c staging: greybus: remove unused macro CAP_TIMEOUT_MS 2026-07-07 11:18:41 +02:00
bootrom.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
camera.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
firmware.h staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
fw-core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fw-download.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fw-management.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gb-camera.h staging: greybus: gb-camera: fix configure_streams indentation 2026-01-11 13:50:20 +01:00
gbphy.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gbphy.h staging: greybus: Add identifier name to function definition argument 2020-08-18 16:07:17 +02:00
gpio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
greybus_authentication.h staging: greybus: Replace __attribute__((packed)) by __packed in various instances 2024-03-07 21:40:52 +00:00
greybus_firmware.h staging: greybus: Replaces directive __attribute__((packed)) by __packed as suggested by checkpatch 2024-03-07 21:40:52 +00:00
hid.c staging: greybus: hid: fix SET_REPORT return value 2026-07-07 11:20:55 +02:00
i2c.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig staging: greybus: Fix spelling mistake in Kconfig 2026-02-23 14:58:24 +01:00
light.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
log.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
loopback.c staging: greybus: Remove unused macro 2026-07-07 11:19:33 +02:00
Makefile staging: greybus: audio: Enable GB codec, audio module compilation. 2020-07-29 16:40:26 +02:00
power_supply.c staging: greybus: power_supply: remove unnecessary parentheses in return 2026-07-07 11:19:57 +02:00
pwm.c staging: greybus: pwm: Fix typo in comment 2026-02-23 14:55:59 +01:00
raw.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
sdio.c staging: greybus: sdio: Remove double whitespace 2026-02-23 14:59:02 +01:00
spi.c staging: greybus: add missing MODULE_DESCRIPTION() macros 2024-06-24 15:17:58 +02:00
spilib.c spi: fix controller registration API inconsistency 2026-05-21 12:25:55 +01:00
spilib.h staging: greybus: fix up SPDX comment in .h files 2019-08-27 19:02:18 +02:00
TODO staging: greybus: remove completed GPIO conversion task from TODO 2026-01-27 15:46:11 +01:00
uart.c tty: fix saved termios reset race 2026-10-01 11:05:17 +02:00
usb.c staging: greybus: add missing MODULE_DESCRIPTION() macros 2024-06-24 15:17:58 +02:00
vibrator.c staging: greybus: vibrator: return device_create() errors 2026-07-07 11:20:00 +02:00