================================================================== BUG: KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl write to 0xffffc900014f3270 of 8 bytes by task 7222 on cpu 0: reset_buffer_flags drivers/tty/n_tty.c:340 [inline] n_tty_flush_buffer+0x9b/0x180 drivers/tty/n_tty.c:371 tty_ldisc_hangup+0x72/0x470 drivers/tty/tty_ldisc.c:694 __tty_hangup+0x3e4/0x560 drivers/tty/tty_io.c:631 tty_vhangup+0x13/0x20 drivers/tty/tty_io.c:701 pty_close+0x25e/0x280 drivers/tty/pty.c:79 tty_release+0x200/0x960 drivers/tty/tty_io.c:1751 __fput+0x245/0x570 fs/file_table.c:320 ____fput+0x11/0x20 fs/file_table.c:348 task_work_run+0xde/0x110 kernel/task_work.c:179 get_signal+0xaf5/0xc60 kernel/signal.c:2635 arch_do_signal_or_restart+0x87/0x2d0 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x78/0x130 kernel/entry/common.c:168 exit_to_user_mode_prepare kernel/entry/common.c:203 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x6a/0x90 kernel/entry/common.c:296 do_syscall_64+0x37/0x70 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd read-write to 0xffffc900014f3270 of 8 bytes by task 1846 on cpu 1: n_tty_lookahead_flow_ctrl+0x4f/0x2f0 drivers/tty/n_tty.c:1490 tty_port_default_lookahead_buf+0x81/0xb0 drivers/tty/tty_port.c:61 lookahead_bufs drivers/tty/tty_buffer.c:498 [inline] flush_to_ldisc+0x33e/0x470 drivers/tty/tty_buffer.c:568 process_one_work+0x3d3/0x720 kernel/workqueue.c:2289 worker_thread+0x618/0xa70 kernel/workqueue.c:2436 kthread+0x1a9/0x1e0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 value changed: 0x000000000000145b -> 0x0000000000000000 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 1846 Comm: kworker/u4:5 Not tainted 6.1.0-rc5-syzkaller-00015-g81e7cfa3a9eb-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: events_unbound flush_to_ldisc ==================================================================