syzbot


KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl (5)

Status: moderation: reported on 2024/03/10 17:13
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+333a571d385057a2f869@syzkaller.appspotmail.com
First crash: 47d, last: 3d02h
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl serial 1 585d 585d 0/26 auto-obsoleted due to no activity on 2022/10/24 16:46
upstream KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl (4) serial 1 127d 127d 0/26 auto-obsoleted due to no activity on 2024/01/26 04:56
upstream KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl (2) serial 14 360d 536d 0/26 auto-obsoleted due to no activity on 2023/06/06 13:18
upstream KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl (3) serial 6 252d 315d 0/26 auto-obsoleted due to no activity on 2023/09/23 08:11

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

read-write to 0xffffc900011e4270 of 8 bytes by task 3819 on cpu 0:
 n_tty_lookahead_flow_ctrl+0x48/0x130 drivers/tty/n_tty.c:1507
 tty_port_default_lookahead_buf+0x8a/0xc0 drivers/tty/tty_port.c:59
 lookahead_bufs drivers/tty/tty_buffer.c:428 [inline]
 flush_to_ldisc+0x31c/0x410 drivers/tty/tty_buffer.c:498
 process_one_work kernel/workqueue.c:3254 [inline]
 process_scheduled_works+0x465/0x990 kernel/workqueue.c:3335
 worker_thread+0x526/0x730 kernel/workqueue.c:3416
 kthread+0x1d1/0x210 kernel/kthread.c:388
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

write to 0xffffc900011e4270 of 8 bytes by task 18469 on cpu 1:
 reset_buffer_flags drivers/tty/n_tty.c:328 [inline]
 n_tty_flush_buffer+0x9f/0x190 drivers/tty/n_tty.c:359
 tty_ldisc_hangup+0x72/0x370 drivers/tty/tty_ldisc.c:693
 __tty_hangup+0x3c6/0x540 drivers/tty/tty_io.c:630
 tty_vhangup+0x17/0x20 drivers/tty/tty_io.c:700
 pty_close+0x262/0x280 drivers/tty/pty.c:79
 tty_release+0x20c/0x940 drivers/tty/tty_io.c:1760
 __fput+0x2c1/0x660 fs/file_table.c:422
 __fput_sync+0x44/0x60 fs/file_table.c:507
 __do_sys_close fs/open.c:1556 [inline]
 __se_sys_close+0x101/0x1b0 fs/open.c:1541
 __x64_sys_close+0x1f/0x30 fs/open.c:1541
 x64_sys_call+0x25b9/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:4
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000002001 -> 0x0000000000002e01

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 18469 Comm: syz-executor.0 Tainted: G        W          6.9.0-rc5-syzkaller-00036-g9d1ddab261f3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/24 09:49 upstream 9d1ddab261f3 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl
2024/04/13 13:51 upstream 8f2c057754b2 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl
2024/04/09 12:48 upstream 20cb38a7af88 f3234354 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl
2024/03/27 04:00 upstream 7033999ecd7b 454571b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl
2024/03/11 14:27 upstream e8f897f4afef 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl
2024/03/10 17:12 upstream 005f6f34bd47 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl
* Struck through repros no longer work on HEAD.