diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2020-12-03 08:58:34 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-09 17:34:37 +0300 |
commit | 2f70e49ed860020f5abae4f7015018ebc10e1f0e (patch) | |
tree | 56869f4085d201a8e8e1f9f6d8b4db6809a18416 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 9ea12edeb9ff6b485bd7ca4aaed541c7a7289046 (diff) | |
download | linux-2f70e49ed860020f5abae4f7015018ebc10e1f0e.tar.xz |
serial_core: Check for port state when tty is in error state
At the moment opening a serial device node (such as /dev/ttyS3)
succeeds even if there is no actual serial device behind it.
Reading/writing/ioctls fail as expected because the uart port is not
initialized (the type is PORT_UNKNOWN) and the TTY_IO_ERROR error state
bit is set fot the tty.
However setting line discipline does not have these checks
8250_port.c (8250 is the default choice made by univ8250_console_init()).
As the result of PORT_UNKNOWN, uart_port::iobase is NULL which
a platform translates onto some address accessing which produces a crash
like below.
This adds tty_port_initialized() to uart_set_ldisc() to prevent the crash.
Found by syzkaller.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Link: https://lore.kernel.org/r/20201203055834.45838-1-aik@ozlabs.ru
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions