syzbot


KCSAN: data-race in n_tty_flush_buffer / n_tty_poll

Status: moderation: reported on 2025/08/28 21:15
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+0425d0c83707555e0188@syzkaller.appspotmail.com
First crash: 97d, last: 16d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in n_tty_flush_buffer / n_tty_poll

write to 0xffffc9000128b000 of 24 bytes by task 9581 on cpu 1:
 reset_buffer_flags drivers/tty/n_tty.c:314 [inline]
 n_tty_flush_buffer+0x52/0x180 drivers/tty/n_tty.c:353
 set_termios+0x3d1/0x4d0 drivers/tty/tty_ioctl.c:500
 tty_mode_ioctl+0x379/0x5c0 drivers/tty/tty_ioctl.c:-1
 n_tty_ioctl_helper+0x91/0x210 drivers/tty/tty_ioctl.c:982
 n_tty_ioctl+0x101/0x200 drivers/tty/n_tty.c:2509
 tty_ioctl+0x83f/0xb80 drivers/tty/tty_io.c:2801
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xce/0x140 fs/ioctl.c:583
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:583
 x64_sys_call+0x1816/0x3000 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffc9000128b010 of 8 bytes by task 9568 on cpu 0:
 input_available_p drivers/tty/n_tty.c:1924 [inline]
 n_tty_poll+0x154/0x450 drivers/tty/n_tty.c:2452
 tty_poll+0x79/0xf0 drivers/tty/tty_io.c:2199
 vfs_poll include/linux/poll.h:82 [inline]
 __io_arm_poll_handler+0x1ee/0xb70 io_uring/poll.c:579
 io_poll_add+0x69/0xe0 io_uring/poll.c:897
 __io_issue_sqe+0xfe/0x2e0 io_uring/io_uring.c:1824
 io_issue_sqe+0x56/0xa80 io_uring/io_uring.c:1847
 io_queue_sqe io_uring/io_uring.c:2074 [inline]
 io_submit_sqe io_uring/io_uring.c:2334 [inline]
 io_submit_sqes+0x675/0x1060 io_uring/io_uring.c:2447
 __do_sys_io_uring_enter io_uring/io_uring.c:3514 [inline]
 __se_sys_io_uring_enter+0x1c1/0x1b70 io_uring/io_uring.c:3453
 __x64_sys_io_uring_enter+0x78/0x90 io_uring/io_uring.c:3453
 x64_sys_call+0x2df0/0x3000 arch/x86/include/generated/asm/syscalls_64.h:427
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000548 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 9568 Comm: syz.3.1187 Tainted: G        W           syzkaller #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/18 13:06 upstream e7c375b18160 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_poll
2025/10/16 13:02 upstream 7ea30958b305 19568248 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_poll
2025/08/28 21:14 upstream 07d9df80082b d401b9d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_poll
* Struck through repros no longer work on HEAD.