syzbot


KCSAN: data-race in do_con_write / stop_tty (8)

Status: moderation: reported on 2025/07/29 15:42
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+e4dc02bc10b806a1ec86@syzkaller.appspotmail.com
First crash: 24d, last: 23d
Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in do_con_write / stop_tty (4) serial 6 2 1107d 1116d 0/29 auto-closed as invalid on 2022/09/14 19:26
upstream KCSAN: data-race in do_con_write / stop_tty (5) serial 6 1 866d 866d 0/29 auto-obsoleted due to no activity on 2023/05/14 17:18
upstream KCSAN: data-race in do_con_write / stop_tty (3) serial 6 6 1229d 1279d 0/29 auto-closed as invalid on 2022/05/16 00:29
upstream KCSAN: data-race in do_con_write / stop_tty (7) serial 6 1 188d 188d 0/29 auto-obsoleted due to no activity on 2025/04/12 02:05
upstream KCSAN: data-race in do_con_write / stop_tty (6) serial 6 1 363d 363d 0/29 auto-obsoleted due to no activity on 2024/09/28 11:28
upstream KCSAN: data-race in do_con_write / stop_tty serial 6 1 1489d 1489d 0/29 auto-closed as invalid on 2021/08/28 20:41
upstream KCSAN: data-race in do_con_write / stop_tty (2) serial 6 7 1382d 1445d 0/29 auto-closed as invalid on 2021/12/14 11:52

Sample crash report:
==================================================================
BUG: KCSAN: data-race in do_con_write / stop_tty

write to 0xffff888118dc09bc of 1 bytes by task 5174 on cpu 1:
 __stop_tty drivers/tty/tty_io.c:744 [inline]
 stop_tty+0x4d/0xb0 drivers/tty/tty_io.c:766
 n_tty_receive_char_flow_ctrl+0xec/0x1a0 drivers/tty/n_tty.c:1238
 n_tty_receive_char_special drivers/tty/n_tty.c:1343 [inline]
 n_tty_receive_buf_standard+0x4d2/0x2f10 drivers/tty/n_tty.c:1588
 __receive_buf drivers/tty/n_tty.c:1624 [inline]
 n_tty_receive_buf_common+0x805/0xbe0 drivers/tty/n_tty.c:1723
 n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1763
 tiocsti+0x16d/0x1d0 drivers/tty/tty_io.c:2290
 tty_ioctl+0x4a4/0xb80 drivers/tty/tty_io.c:2706
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:598 [inline]
 __se_sys_ioctl+0xce/0x140 fs/ioctl.c:584
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:584
 x64_sys_call+0x1816/0x2ff0 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 0xffff888118dc09bc of 1 bytes by task 5172 on cpu 0:
 do_con_write+0x16b2/0x2940 drivers/tty/vt/vt.c:3154
 con_write+0x24/0x40 drivers/tty/vt/vt.c:3516
 process_output_block drivers/tty/n_tty.c:561 [inline]
 n_tty_write+0x7db/0xb10 drivers/tty/n_tty.c:2377
 iterate_tty_write drivers/tty/tty_io.c:1006 [inline]
 file_tty_write+0x38c/0x670 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+0x49d/0x8e0 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+0x27fe/0x2ff0 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

value changed: 0x00 -> 0x01

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 5172 Comm: syz.1.663 Not tainted 6.16.0-syzkaller-04405-g4b290aae788e #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/30 10:21 upstream 4b290aae788e f8f2b4da .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in do_con_write / stop_tty
2025/07/29 15:42 upstream ae388edd4a8f c4a95487 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in do_con_write / stop_tty
* Struck through repros no longer work on HEAD.