syzbot


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

Status: moderation: reported on 2024/11/21 04:14
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+334029b8f1a374a5d07c@syzkaller.appspotmail.com
First crash: 177d, last: 8d21h
Similar bugs (6)
Kernel Title 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 36 1013d 1351d 0/28 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 5 772d 863d 0/28 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 263d 338d 0/28 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 1 1762d 1762d 0/28 auto-closed as invalid on 2020/08/23 22:27
upstream KCSAN: data-race in n_tty_receive_buf_common / n_tty_write (5) serial 41 382d 525d 0/28 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 5 926d 969d 0/28 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 0xffffc9000496d020 of 8 bytes by task 23412 on cpu 0:
 process_echoes drivers/tty/n_tty.c:772 [inline]
 n_tty_write+0x1aa/0xb10 drivers/tty/n_tty.c:2363
 iterate_tty_write drivers/tty/tty_io.c:1015 [inline]
 file_tty_write+0x389/0x670 drivers/tty/tty_io.c:1090
 tty_write+0x25/0x30 drivers/tty/tty_io.c:1111
 new_sync_write fs/read_write.c:591 [inline]
 vfs_write+0x49d/0x8d0 fs/read_write.c:684
 ksys_write+0xda/0x1a0 fs/read_write.c:736
 __do_sys_write fs/read_write.c:747 [inline]
 __se_sys_write fs/read_write.c:744 [inline]
 __x64_sys_write+0x40/0x50 fs/read_write.c:744
 x64_sys_call+0x2cdd/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffc9000496d020 of 8 bytes by task 3333 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+0x1b2/0x410 drivers/tty/tty_buffer.c:495
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x4cb/0x9d0 kernel/workqueue.c:3319
 worker_thread+0x582/0x770 kernel/workqueue.c:3400
 kthread+0x486/0x510 kernel/kthread.c:464
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

value changed: 0x000000000000807e -> 0x0000000000008080

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 3333 Comm: kworker/u8:6 Not tainted 6.15.0-rc5-syzkaller-00043-gd76bb1ebb558 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Workqueue: events_unbound flush_to_ldisc
==================================================================

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/08 08:24 upstream d76bb1ebb558 dbf35fa1 .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
2025/04/27 08:13 upstream 5bc1018675ec c6b4fb39 .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
2025/04/18 13:42 upstream fc96b232f8e7 2a20f901 .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
2025/04/11 00:06 upstream 2eb959eeecc6 1ef3ab4d .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
2025/03/17 21:45 upstream 4701f33a1070 ce3352cd .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
2025/03/01 11:49 upstream 7a5668899f54 67cf5345 .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
2025/01/12 08:58 upstream b62cef9a5c67 6dbc6a9b .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
2025/01/09 05:18 upstream 0b7958fa05d5 f3558dbf .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
2024/11/21 04:13 upstream 8f7c8b88bda4 4b25d554 .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.