syzbot


KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (8)

Status: moderation: reported on 2025/10/09 09:28
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+07cd7ba34f8abdb81413@syzkaller.appspotmail.com
First crash: 18h40m, last: 18h40m
Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (2) serial 6 36 1159d 1497d 0/29 auto-closed as invalid on 2022/09/11 21:39
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (4) serial 6 5 918d 1009d 0/29 auto-obsoleted due to no activity on 2023/05/10 10:49
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (6) serial 6 6 409d 484d 0/29 auto-obsoleted due to no activity on 2024/09/30 21:50
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write serial 6 1 1908d 1908d 0/29 auto-closed as invalid on 2020/08/23 22:27
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (7) serial 6 13 57d 322d 0/29 auto-obsoleted due to no activity on 2025/10/08 13:05
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (5) serial 6 41 528d 671d 0/29 auto-obsoleted due to no activity on 2024/06/03 08:33
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (3) serial 6 5 1072d 1115d 0/29 auto-obsoleted due to no activity on 2022/12/07 10:52

Sample crash report:
==================================================================
BUG: KCSAN: data-race in n_tty_receive_buf_common / n_tty_write

write to 0xffffc900112b9020 of 8 bytes by task 6707 on cpu 0:
 process_echoes drivers/tty/n_tty.c:772 [inline]
 n_tty_write+0x1aa/0xb40 drivers/tty/n_tty.c:2363
 iterate_tty_write drivers/tty/tty_io.c:1006 [inline]
 file_tty_write+0x378/0x690 drivers/tty/tty_io.c:1081
 tty_write+0x25/0x30 drivers/tty/tty_io.c:1102
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x52a/0x960 fs/read_write.c:686
 ksys_write+0xda/0x1a0 fs/read_write.c:738
 __do_sys_write fs/read_write.c:749 [inline]
 __se_sys_write fs/read_write.c:746 [inline]
 __x64_sys_write+0x40/0x50 fs/read_write.c:746
 x64_sys_call+0x2802/0x3000 arch/x86/include/generated/asm/syscalls_64.h:2
 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 0xffffc900112b9020 of 8 bytes by task 52 on cpu 1:
 flush_echoes drivers/tty/n_tty.c:786 [inline]
 __receive_buf drivers/tty/n_tty.c:1626 [inline]
 n_tty_receive_buf_common+0x87c/0xbe0 drivers/tty/n_tty.c:1723
 n_tty_receive_buf2+0x33/0x40 drivers/tty/n_tty.c:1769
 tty_ldisc_receive_buf+0x63/0xf0 drivers/tty/tty_buffer.c:387
 tty_port_default_receive_buf+0x59/0x90 drivers/tty/tty_port.c:37
 receive_buf drivers/tty/tty_buffer.c:445 [inline]
 flush_to_ldisc+0x148/0x340 drivers/tty/tty_buffer.c:495
 process_one_work kernel/workqueue.c:3263 [inline]
 process_scheduled_works+0x4cb/0x9d0 kernel/workqueue.c:3346
 worker_thread+0x582/0x770 kernel/workqueue.c:3427
 kthread+0x486/0x510 kernel/kthread.c:463
 ret_from_fork+0x122/0x1b0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

value changed: 0x0000000000000000 -> 0x0000000000000009

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 52 Comm: kworker/u8:3 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Workqueue: events_unbound flush_to_ldisc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/09 09:27 upstream cd5a0afbdf80 7e2882b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_receive_buf_common / n_tty_write
* Struck through repros no longer work on HEAD.