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: 160d, last: 9d13h
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 944d 944d 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 247d 406d 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 485d 485d 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 719d 894d 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 610d 673d 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 0xffffc90000f01270 of 8 bytes by task 8876 on cpu 0:
 reset_buffer_flags drivers/tty/n_tty.c:322 [inline]
 n_tty_flush_buffer+0xaa/0x190 drivers/tty/n_tty.c:353
 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+0x260/0x280 drivers/tty/pty.c:79
 tty_release+0x204/0x940 drivers/tty/tty_io.c:1754
 __fput+0x2ac/0x640 fs/file_table.c:465
 ____fput+0x1c/0x30 fs/file_table.c:493
 task_work_run+0x13c/0x1b0 kernel/task_work.c:227
 get_signal+0xee2/0x1080 kernel/signal.c:2807
 arch_do_signal_or_restart+0x9a/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/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read-write to 0xffffc90000f01270 of 8 bytes by task 7086 on cpu 1:
 n_tty_lookahead_flow_ctrl+0x48/0x130 drivers/tty/n_tty.c:1491
 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+0x322/0x410 drivers/tty/tty_buffer.c:498
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x4de/0xa20 kernel/workqueue.c:3319
 worker_thread+0x52c/0x710 kernel/workqueue.c:3400
 kthread+0x4b7/0x540 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: 0x0000000000000ed2 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 7086 Comm: kworker/u8:9 Not tainted 6.15.0-rc1-syzkaller-00246-g900241a5cc15 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Workqueue: events_unbound flush_to_ldisc
==================================================================

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/11 09:32 upstream 900241a5cc15 94486846 .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
2025/04/08 06:36 upstream 0af2f6be1b42 a2ada0e7 .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
2025/03/29 13:05 upstream 7d06015d936c cf25e2c2 .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
2025/03/19 15:43 upstream 81e4f8d68c66 e20d7b13 .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
2025/03/10 04:02 upstream 80e54e84911a 163f510d .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
2025/02/01 00:30 upstream 69b8923f5003 aa47157c .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
2025/01/27 14:49 upstream 9c5968db9e62 d99a33ad .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
2025/01/27 04:58 upstream c2da8b3f914f 9fbd772e .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/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.