==================================================================
BUG: KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl

write to 0xffffc9000f257270 of 8 bytes by task 5026 on cpu 1:
 reset_buffer_flags drivers/tty/n_tty.c:339 [inline]
 n_tty_flush_buffer+0x9f/0x180 drivers/tty/n_tty.c:370
 tty_ldisc_hangup+0x6e/0x360 drivers/tty/tty_ldisc.c:693
 __tty_hangup+0x3c6/0x520 drivers/tty/tty_io.c:632
 tty_vhangup+0x17/0x20 drivers/tty/tty_io.c:702
 pty_close+0x262/0x280 drivers/tty/pty.c:79
 tty_release+0x204/0x930 drivers/tty/tty_io.c:1762
 __fput+0x2fd/0x600 fs/file_table.c:384
 ____fput+0x15/0x20 fs/file_table.c:412
 task_work_run+0x135/0x1a0 kernel/task_work.c:179
 get_signal+0xe6a/0xff0 kernel/signal.c:2657
 arch_do_signal_or_restart+0x89/0x2a0 arch/x86/kernel/signal.c:308
 exit_to_user_mode_loop+0x6f/0xe0 kernel/entry/common.c:168
 exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297
 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read-write to 0xffffc9000f257270 of 8 bytes by task 21098 on cpu 0:
 n_tty_lookahead_flow_ctrl+0x46/0x120 drivers/tty/n_tty.c:1489
 tty_port_default_lookahead_buf+0x85/0xb0 drivers/tty/tty_port.c:61
 lookahead_bufs drivers/tty/tty_buffer.c:498 [inline]
 flush_to_ldisc+0x30a/0x400 drivers/tty/tty_buffer.c:568
 process_one_work+0x434/0x860 kernel/workqueue.c:2600
 worker_thread+0x5f2/0xa10 kernel/workqueue.c:2751
 kthread+0x1d7/0x210 kernel/kthread.c:389
 ret_from_fork+0x2e/0x40 arch/x86/kernel/process.c:145
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

value changed: 0x0000000000003000 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 21098 Comm: kworker/u4:43 Not tainted 6.5.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: events_unbound flush_to_ldisc
==================================================================