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: 4d01h, last: 4d01h

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

write to 0xffffc90006d5b000 of 24 bytes by task 9965 on cpu 0:
 reset_buffer_flags drivers/tty/n_tty.c:314 [inline]
 n_tty_flush_buffer+0x52/0x180 drivers/tty/n_tty.c:353
 tty_ldisc_hangup+0x77/0x370 drivers/tty/tty_ldisc.c:699
 __tty_hangup+0x3c2/0x540 drivers/tty/tty_io.c:621
 tty_vhangup+0x17/0x20 drivers/tty/tty_io.c:691
 pty_close+0x266/0x290 drivers/tty/pty.c:79
 tty_release+0x1fc/0xb10 drivers/tty/tty_io.c:1745
 __fput+0x298/0x650 fs/file_table.c:468
 ____fput+0x1c/0x30 fs/file_table.c:496
 task_work_run+0x131/0x1a0 kernel/task_work.c:227
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop+0xe4/0x100 kernel/entry/common.c:43
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
 do_syscall_64+0x1d6/0x200 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffc90006d5b008 of 8 bytes by task 9968 on cpu 1:
 input_available_p drivers/tty/n_tty.c:1926 [inline]
 n_tty_poll+0x2dd/0x450 drivers/tty/n_tty.c:2456
 tty_poll+0x79/0xf0 drivers/tty/tty_io.c:2199
 vfs_poll include/linux/poll.h:82 [inline]
 io_poll_check_events io_uring/poll.c:262 [inline]
 io_poll_task_func+0x143/0x910 io_uring/poll.c:317
 io_handle_tw_list+0xcc/0x1c0 io_uring/io_uring.c:1102
 tctx_task_work_run+0x6d/0x1a0 io_uring/io_uring.c:1167
 tctx_task_work+0x3f/0x80 io_uring/io_uring.c:1185
 task_work_run+0x131/0x1a0 kernel/task_work.c:227
 get_signal+0xe13/0xf70 kernel/signal.c:2807
 arch_do_signal_or_restart+0x96/0x480 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop+0x7a/0x100 kernel/entry/common.c:40
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
 do_syscall_64+0x1d6/0x200 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x000000000000892e -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 9968 Comm: syz.1.2591 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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.