diff options
| author | Johan Hovold <[email protected]> | 2021-10-15 13:14:20 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2021-10-21 10:37:10 +0200 |
| commit | 211cde4f5817dc88ef7f8f2fa286e57fbf14c8ee (patch) | |
| tree | ad536096d731c315a8dd32a05cfa9ad09893ed4c /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | d1ec8a2eabe969b333031e8fb36fe7fc61a5f0ac (diff) | |
serial: 8250: fix racy uartclk update
Commit 868f3ee6e452 ("serial: 8250: Add 8250 port clock update method")
added a hack to support SoCs where the UART reference clock can
change behind the back of the driver but failed to add the proper
locking.
First, make sure to take a reference to the tty struct to avoid
dereferencing a NULL pointer if the clock change races with a hangup.
Second, the termios semaphore must be held during the update to prevent
a racing termios change.
Fixes: 868f3ee6e452 ("serial: 8250: Add 8250 port clock update method")
Fixes: c8dff3aa8241 ("serial: 8250: Skip uninitialized TTY port baud rate update")
Cc: [email protected] # 5.9
Cc: Serge Semin <[email protected]>
Tested-by: Serge Semin <[email protected]>
Reviewed-by: Serge Semin <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions