syzbot


KCSAN: data-race in n_tty_write / tty_set_termios (12)

Status: moderation: reported on 2024/11/30 05:29
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+96f81506909b748ac50e@syzkaller.appspotmail.com
First crash: 21d, last: 7d19h
Similar bugs (11)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in n_tty_write / tty_set_termios (3) serial 1 1514d 1514d 0/28 auto-closed as invalid on 2020/12/02 18:50
upstream KCSAN: data-race in n_tty_write / tty_set_termios (10) serial 1 611d 611d 0/28 auto-obsoleted due to no activity on 2023/05/24 17:53
upstream KCSAN: data-race in n_tty_write / tty_set_termios (8) serial 9 855d 981d 0/28 auto-closed as invalid on 2022/09/22 18:33
upstream KCSAN: data-race in n_tty_write / tty_set_termios (4) serial 3 1423d 1473d 0/28 auto-closed as invalid on 2021/03/04 08:49
upstream KCSAN: data-race in n_tty_write / tty_set_termios (2) serial 1 1579d 1579d 0/28 auto-closed as invalid on 2020/09/29 07:57
upstream KCSAN: data-race in n_tty_write / tty_set_termios (6) serial 8 1141d 1260d 0/28 auto-closed as invalid on 2021/12/10 21:01
upstream KCSAN: data-race in n_tty_write / tty_set_termios (11) serial 3 180d 185d 0/28 auto-obsoleted due to no activity on 2024/07/29 01:08
upstream KCSAN: data-race in n_tty_write / tty_set_termios (5) serial 2 1312d 1314d 0/28 auto-closed as invalid on 2021/06/22 15:42
upstream KCSAN: data-race in n_tty_write / tty_set_termios serial 1 1641d 1641d 0/28 auto-closed as invalid on 2020/07/29 04:13
upstream KCSAN: data-race in n_tty_write / tty_set_termios (7) serial 4 1023d 1061d 0/28 auto-closed as invalid on 2022/04/07 21:37
upstream KCSAN: data-race in n_tty_write / tty_set_termios (9) serial 7 702d 783d 0/28 auto-obsoleted due to no activity on 2023/02/26 21:46

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

read-write to 0xffff88814e300d14 of 4 bytes by task 18701 on cpu 1:
 unset_locked_termios drivers/tty/tty_ioctl.c:217 [inline]
 tty_set_termios+0x1a2/0x8b0 drivers/tty/tty_ioctl.c:340
 set_termios+0x365/0x4e0 drivers/tty/tty_ioctl.c:520
 tty_mode_ioctl+0x391/0x5d0
 n_tty_ioctl_helper+0x8d/0x240 drivers/tty/tty_ioctl.c:986
 n_tty_ioctl+0xfd/0x200 drivers/tty/n_tty.c:2521
 tty_ioctl+0x87a/0xbe0 drivers/tty/tty_io.c:2812
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl+0xc9/0x140 fs/ioctl.c:892
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:892
 x64_sys_call+0x1690/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88814e300d14 of 4 bytes by task 18700 on cpu 0:
 n_tty_write+0xa0/0xb80 drivers/tty/n_tty.c:2366
 iterate_tty_write drivers/tty/tty_io.c:1015 [inline]
 file_tty_write+0x37a/0x680 drivers/tty/tty_io.c:1090
 tty_write+0x28/0x30 drivers/tty/tty_io.c:1111
 new_sync_write fs/read_write.c:586 [inline]
 vfs_write+0x77f/0x920 fs/read_write.c:679
 ksys_write+0xe8/0x1b0 fs/read_write.c:731
 __do_sys_write fs/read_write.c:742 [inline]
 __se_sys_write fs/read_write.c:739 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:739
 x64_sys_call+0x287e/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00008a3b -> 0x00000006

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 18700 Comm: syz.9.20585 Not tainted 6.13.0-rc2-syzkaller-00192-g243f750a2df0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/13 19:02 upstream 243f750a2df0 3547e30f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_set_termios
2024/12/10 03:44 upstream 7cb1b4663150 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_set_termios
2024/12/09 04:27 upstream 62b5a46999c7 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_set_termios
2024/11/30 05:28 upstream 509f806f7f70 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_set_termios
* Struck through repros no longer work on HEAD.