==================================================================
BUG: KCSAN: data-race in __process_echoes / n_tty_write

write to 0xffffc90001173280 of 8 bytes by task 30994 on cpu 1:
 __process_echoes+0x603/0x650 drivers/tty/n_tty.c:756
 flush_echoes drivers/tty/n_tty.c:817 [inline]
 __receive_buf drivers/tty/n_tty.c:1615 [inline]
 n_tty_receive_buf_common+0x844/0xbf0 drivers/tty/n_tty.c:1711
 n_tty_receive_buf2+0x2e/0x40 drivers/tty/n_tty.c:1746
 tty_ldisc_receive_buf+0x5b/0xf0 drivers/tty/tty_buffer.c:457
 paste_selection+0x1d9/0x2d0 drivers/tty/vt/selection.c:409
 tioclinux+0xee/0x3e0 drivers/tty/vt/vt.c:3204
 vt_ioctl+0x263/0x13c0 drivers/tty/vt/vt_ioctl.c:762
 tty_ioctl+0x6be/0x970 drivers/tty/tty_io.c:2778
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:856
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffffc90001173280 of 8 bytes by task 30970 on cpu 0:
 process_echoes drivers/tty/n_tty.c:794 [inline]
 n_tty_write+0x14e/0xb10 drivers/tty/n_tty.c:2336
 do_tty_write drivers/tty/tty_io.c:1024 [inline]
 file_tty_write+0x3f9/0x650 drivers/tty/tty_io.c:1095
 tty_write+0x24/0x30 drivers/tty/tty_io.c:1116
 do_iter_write+0x494/0x750 fs/read_write.c:855
 vfs_writev fs/read_write.c:928 [inline]
 do_writev+0x256/0x4b0 fs/read_write.c:971
 __do_sys_writev fs/read_write.c:1044 [inline]
 __se_sys_writev fs/read_write.c:1041 [inline]
 __x64_sys_writev+0x41/0x50 fs/read_write.c:1041
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x0000000000000006 -> 0x0000000000000008

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 30970 Comm: syz-executor.0 Not tainted 6.0.0-rc2-syzkaller-00283-g10d4879f9ef0-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
==================================================================