diff options
| author | Johan Hovold <johan@kernel.org> | 2026-09-10 15:08:14 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-23 12:00:46 +0200 |
| commit | 8ca59f7baee7c72cf7729950b4ab2e7f910c9549 (patch) | |
| tree | 58cc61d295eb5af7ff5e55f2c445e0e62593df60 /tools/lib/python | |
| parent | f658e6bcd00a4eafaa9c98c0b7483cc2c5dac539 (diff) | |
| download | linux-next-8ca59f7baee7c72cf7729950b4ab2e7f910c9549.tar.gz linux-next-8ca59f7baee7c72cf7729950b4ab2e7f910c9549.zip | |
serial: fix ioctl hangup race
The tty ioctls can race with hangup and end up calling into a tty
driver for a device that is already gone or powered down.
Add the missing checks to make sure the port has not been hung up before
accessing the hardware to avoid issues like kernel panic due to
unclocked accesses.
Note that TIOCGSERIAL, TIOCGICOUNT do not access hardware and are
therefore not affected by the race.
Also note that the initialised check in uart_set_ldisc() added by commit
2f70e49ed860 ("serial_core: Check for port state when tty is in error
state") should have been done under the port lock to avoid racing with
uart_do_autoconfig().
Fixes: 04f378b198da ("tty: BKL pushdown")
Cc: stable@kernel.org # 2.6.26
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260910130816.642699-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
