syzbot


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

Status: moderation: reported on 2024/11/11 06:22
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+c7584e16b268d10c87e7@syzkaller.appspotmail.com
First crash: 24d, last: 2d15h
Similar bugs (5)
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 808d 808d 0/28 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 (5) serial 11 111d 270d 0/28 auto-obsoleted due to no activity on 2024/09/20 19:47
upstream KCSAN: data-race in n_tty_flush_buffer / n_tty_lookahead_flow_ctrl (4) serial 1 349d 349d 0/28 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 583d 758d 0/28 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 474d 537d 0/28 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

write to 0xffffc90003f8a270 of 8 bytes by task 13407 on cpu 0:
 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:699
 __tty_hangup+0x3b1/0x530 drivers/tty/tty_io.c:624
 tty_vhangup+0x17/0x20 drivers/tty/tty_io.c:694
 pty_close+0x262/0x280 drivers/tty/pty.c:79
 tty_release+0x206/0x930 drivers/tty/tty_io.c:1754
 __fput+0x17a/0x6d0 fs/file_table.c:450
 ____fput+0x1c/0x30 fs/file_table.c:478
 task_work_run+0x13a/0x1a0 kernel/task_work.c:239
 get_signal+0xe78/0x1000 kernel/signal.c:2790
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x62/0x120 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read-write to 0xffffc90003f8a270 of 8 bytes by task 2142 on cpu 1:
 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:3229 [inline]
 process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3310
 worker_thread+0x51d/0x6f0 kernel/workqueue.c:3391
 kthread+0x1d1/0x210 kernel/kthread.c:389
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

value changed: 0x00000000000027ff -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 2142 Comm: kworker/u8:8 Not tainted 6.13.0-rc1-syzkaller-00002-gcdd30ebb1b9f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events_unbound flush_to_ldisc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/03 05:34 upstream cdd30ebb1b9f 578925bc .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/11/25 17:13 upstream 9f16d5e6f220 68da6d95 .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/11/11 06:22 upstream a9cda7c0ffed 6b856513 .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.