syzbot


KCSAN: data-race in __process_echoes / n_tty_write (3)

Status: auto-closed as invalid on 2021/07/04 10:36
Subsystems: serial
[Documentation on labels]
First crash: 1127d, last: 1062d
Similar bugs (10)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __process_echoes / n_tty_write (9) serial 4 284d 330d 0/26 auto-obsoleted due to no activity on 2023/08/21 10:01
upstream KCSAN: data-race in __process_echoes / n_tty_write serial 3 1349d 1390d 0/26 auto-closed as invalid on 2020/09/20 17:41
upstream KCSAN: data-race in __process_echoes / n_tty_write (11) serial 13 15d 93d 0/26 moderation: reported on 2024/01/24 10:51
upstream KCSAN: data-race in __process_echoes / n_tty_write (10) serial 10 139d 139d 0/26 auto-obsoleted due to no activity on 2024/01/14 04:02
upstream KCSAN: data-race in __process_echoes / n_tty_write (4) serial 1 1020d 1020d 0/26 auto-closed as invalid on 2021/08/15 21:06
upstream KCSAN: data-race in __process_echoes / n_tty_write (6) serial 41 571d 866d 0/26 auto-obsoleted due to no activity on 2022/11/07 20:53
upstream KCSAN: data-race in __process_echoes / n_tty_write (2) serial 4 1217d 1236d 0/26 auto-closed as invalid on 2021/01/30 23:25
upstream KCSAN: data-race in __process_echoes / n_tty_write (7) serial 2 515d 516d 0/26 auto-obsoleted due to no activity on 2023/01/13 20:09
upstream KCSAN: data-race in __process_echoes / n_tty_write (5) serial 1 940d 940d 0/26 auto-closed as invalid on 2021/11/04 02:47
upstream KCSAN: data-race in __process_echoes / n_tty_write (8) serial 3 378d 431d 0/26 auto-obsoleted due to no activity on 2023/05/19 15:46

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

write to 0xffffc90000337278 of 8 bytes by task 2674 on cpu 0:
 __process_echoes+0x607/0x660 drivers/tty/n_tty.c:765
 flush_echoes drivers/tty/n_tty.c:826 [inline]
 __receive_buf drivers/tty/n_tty.c:1645 [inline]
 n_tty_receive_buf_common+0x1ba4/0x1e20 drivers/tty/n_tty.c:1740
 n_tty_receive_buf2+0x2e/0x40 drivers/tty/n_tty.c:1775
 tty_ldisc_receive_buf+0x5b/0xf0 drivers/tty/tty_buffer.c:461
 tty_port_default_receive_buf+0x54/0x80 drivers/tty/tty_port.c:39
 receive_buf drivers/tty/tty_buffer.c:481 [inline]
 flush_to_ldisc+0x1c5/0x2c0 drivers/tty/tty_buffer.c:533
 process_one_work+0x3e9/0x8f0 kernel/workqueue.c:2276
 worker_thread+0x636/0xae0 kernel/workqueue.c:2422
 kthread+0x1d0/0x1f0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

read to 0xffffc90000337278 of 8 bytes by task 12203 on cpu 1:
 process_echoes drivers/tty/n_tty.c:803 [inline]
 n_tty_write+0x147/0xaf0 drivers/tty/n_tty.c:2340
 do_tty_write drivers/tty/tty_io.c:1043 [inline]
 file_tty_write+0x409/0x660 drivers/tty/tty_io.c:1133
 tty_write+0x24/0x30 drivers/tty/tty_io.c:1140
 call_write_iter include/linux/fs.h:2114 [inline]
 do_iter_readv_writev+0x2cb/0x360 fs/read_write.c:740
 do_iter_write+0x112/0x4c0 fs/read_write.c:866
 vfs_writev fs/read_write.c:939 [inline]
 do_writev+0x1e0/0x400 fs/read_write.c:982
 __do_sys_writev fs/read_write.c:1055 [inline]
 __se_sys_writev fs/read_write.c:1052 [inline]
 __x64_sys_writev+0x41/0x50 fs/read_write.c:1052
 do_syscall_64+0x4a/0x90 arch/x86/entry/common.c:47
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x000000000000037f -> 0x0000000000000380

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 12203 Comm: syz-executor.2 Tainted: G        W         5.13.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================
FAULT_INJECTION: forcing a failure.
name fail_usercopy, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 12203 Comm: syz-executor.2 Tainted: G        W         5.13.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x137/0x19d lib/dump_stack.c:120
 fail_dump lib/fault-inject.c:52 [inline]
 should_fail+0x23c/0x250 lib/fault-inject.c:146
 should_fail_usercopy+0x16/0x20 lib/fault-inject-usercopy.c:37
 copyin lib/iov_iter.c:197 [inline]
 _copy_from_iter+0x179/0xba0 lib/iov_iter.c:809
 copy_from_iter include/linux/uio.h:154 [inline]
 do_tty_write drivers/tty/tty_io.c:1040 [inline]
 file_tty_write+0x3d1/0x660 drivers/tty/tty_io.c:1133
 tty_write+0x24/0x30 drivers/tty/tty_io.c:1140
 call_write_iter include/linux/fs.h:2114 [inline]
 do_iter_readv_writev+0x2cb/0x360 fs/read_write.c:740
 do_iter_write+0x112/0x4c0 fs/read_write.c:866
 vfs_writev fs/read_write.c:939 [inline]
 do_writev+0x1e0/0x400 fs/read_write.c:982
 __do_sys_writev fs/read_write.c:1055 [inline]
 __se_sys_writev fs/read_write.c:1052 [inline]
 __x64_sys_writev+0x41/0x50 fs/read_write.c:1052
 do_syscall_64+0x4a/0x90 arch/x86/entry/common.c:47
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665d9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff9a3f9d188 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9
RDX: 0000000000000001 RSI: 00000000200005c0 RDI: 0000000000000003
RBP: 00007ff9a3f9d1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007fff62cd99ff R14: 00007ff9a3f9d300 R15: 0000000000022000

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/30 10:27 upstream b90e90f40b4f 325a8dab .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __process_echoes / n_tty_write
2021/05/07 19:04 upstream e48661230cc3 f6da8120 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __process_echoes / n_tty_write
2021/05/04 17:15 upstream 5e321ded302d 06c27ff5 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __process_echoes / n_tty_write
2021/05/02 23:51 upstream 17ae69aba89d 77e2b668 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __process_echoes / n_tty_write
2021/04/17 08:26 upstream 9cdbf6467424 7e2b734b .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __process_echoes / n_tty_write
2021/04/08 00:10 upstream 3a22981230f9 6a81331a .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __process_echoes / n_tty_write
2021/03/26 07:13 upstream 002322402daf 6a383ecf .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __process_echoes / n_tty_write
* Struck through repros no longer work on HEAD.