syzbot


KCSAN: data-race in n_tty_close / pty_close (6)

Status: moderation: reported on 2025/05/29 06:42
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+197fd9f24020253ddafd@syzkaller.appspotmail.com
First crash: 1d17h, last: 1d17h
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in n_tty_close / pty_close (4) serial 3 314d 334d 0/28 auto-obsoleted due to no activity on 2024/08/24 22:26
upstream KCSAN: data-race in n_tty_close / pty_close serial 1 1711d 1711d 0/28 auto-closed as invalid on 2020/10/27 12:08
upstream KCSAN: data-race in n_tty_close / pty_close (2) serial 1 1103d 1103d 0/28 auto-closed as invalid on 2022/06/27 03:27
upstream KCSAN: data-race in n_tty_close / pty_close (5) serial 1 264d 264d 0/28 auto-obsoleted due to no activity on 2024/10/13 16:18
upstream KCSAN: data-race in n_tty_close / pty_close (3) serial 1 470d 470d 0/28 auto-obsoleted due to no activity on 2024/03/21 21:07

Sample crash report:
==================================================================
BUG: KCSAN: data-race in n_tty_close / pty_close

write to 0xffff8881198165d5 of 1 bytes by task 4873 on cpu 0:
 pty_close+0x126/0x290 drivers/tty/pty.c:61
 tty_release+0x1fc/0xb10 drivers/tty/tty_io.c:1754
 __fput+0x29b/0x650 fs/file_table.c:465
 ____fput+0x1c/0x30 fs/file_table.c:493
 task_work_run+0x12e/0x1a0 kernel/task_work.c:227
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop+0xe4/0x100 kernel/entry/common.c:114
 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline]
 do_syscall_64+0x1d6/0x200 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881198165d5 of 1 bytes by task 4874 on cpu 1:
 n_tty_packet_mode_flush drivers/tty/n_tty.c:329 [inline]
 n_tty_close+0x54/0x120 drivers/tty/n_tty.c:1880
 tty_ldisc_close drivers/tty/tty_ldisc.c:455 [inline]
 tty_ldisc_kill+0x8a/0x140 drivers/tty/tty_ldisc.c:613
 tty_ldisc_hangup+0x2fa/0x370 drivers/tty/tty_ldisc.c:729
 __tty_hangup+0x395/0x510 drivers/tty/tty_io.c:624
 tty_vhangup drivers/tty/tty_io.c:694 [inline]
 tty_ioctl+0x601/0xb80 drivers/tty/tty_io.c:2742
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xce/0x140 fs/ioctl.c:893
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:893
 x64_sys_call+0x19a8/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x01 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 4874 Comm: syz.1.558 Not tainted 6.15.0-syzkaller-07774-g90b83efa6701 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/29 06:42 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_close / pty_close
* Struck through repros no longer work on HEAD.