syzbot


KCSAN: data-race in n_tty_write / tty_reopen (8)

Status: moderation: reported on 2024/01/19 08:53
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+69b06d495ab3fa1db867@syzkaller.appspotmail.com
First crash: 92d, last: 21d
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in n_tty_write / tty_reopen serial 2 1090d 1101d 0/26 auto-closed as invalid on 2021/05/31 23:44
upstream KCSAN: data-race in n_tty_write / tty_reopen (3) serial 5 918d 984d 0/26 auto-closed as invalid on 2021/11/19 17:25
upstream KCSAN: data-race in n_tty_write / tty_reopen (6) serial 1 266d 266d 0/26 auto-obsoleted due to no activity on 2023/09/03 02:21
upstream KCSAN: data-race in n_tty_write / tty_reopen (4) serial 3 822d 851d 0/26 auto-closed as invalid on 2022/02/23 15:12
upstream KCSAN: data-race in n_tty_write / tty_reopen (7) serial 1 147d 131d 0/26 auto-obsoleted due to no activity on 2023/12/30 14:50
upstream KCSAN: data-race in n_tty_write / tty_reopen (5) serial 1 761d 761d 0/26 auto-closed as invalid on 2022/04/26 05:30
upstream KCSAN: data-race in n_tty_write / tty_reopen (2) serial 1 1038d 1038d 0/26 auto-closed as invalid on 2021/07/23 04:44

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

read-write to 0xffff888107316da8 of 4 bytes by task 30512 on cpu 0:
 tty_reopen+0x10c/0x1b0 drivers/tty/tty_io.c:1371
 tty_open_by_driver drivers/tty/tty_io.c:2082 [inline]
 tty_open+0x8ff/0xb00 drivers/tty/tty_io.c:2135
 chrdev_open+0x323/0x3a0 fs/char_dev.c:414
 do_dentry_open+0x63c/0xbe0 fs/open.c:955
 vfs_open+0x4a/0x60 fs/open.c:1089
 do_open fs/namei.c:3642 [inline]
 path_openat+0x18ba/0x1d80 fs/namei.c:3799
 do_filp_open+0xf7/0x200 fs/namei.c:3826
 do_sys_openat2+0xab/0x120 fs/open.c:1406
 do_sys_open fs/open.c:1421 [inline]
 __do_sys_openat fs/open.c:1437 [inline]
 __se_sys_openat fs/open.c:1432 [inline]
 __x64_sys_openat+0xf3/0x120 fs/open.c:1432
 do_syscall_64+0xd3/0x1d0
 entry_SYSCALL_64_after_hwframe+0x72/0x7a

read to 0xffff888107316da8 of 4 bytes by task 30509 on cpu 1:
 n_tty_write+0x329/0xb90 drivers/tty/n_tty.c:2373
 iterate_tty_write drivers/tty/tty_io.c:1021 [inline]
 file_tty_write+0x386/0x690 drivers/tty/tty_io.c:1096
 tty_write+0x28/0x30 drivers/tty/tty_io.c:1117
 call_write_iter include/linux/fs.h:2108 [inline]
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0x771/0x8e0 fs/read_write.c:590
 ksys_write+0xeb/0x1b0 fs/read_write.c:643
 __do_sys_write fs/read_write.c:655 [inline]
 __se_sys_write fs/read_write.c:652 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:652
 do_syscall_64+0xd3/0x1d0
 entry_SYSCALL_64_after_hwframe+0x72/0x7a

value changed: 0x00000001 -> 0x00000002

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 30509 Comm: syz-executor.0 Not tainted 6.9.0-rc1-syzkaller-00274-g486291a0e624 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/31 00:04 upstream 486291a0e624 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_reopen
2024/02/26 15:19 upstream d206a76d7d27 da36a36b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_reopen
2024/02/21 09:42 upstream fca7526b7d89 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_reopen
2024/01/19 08:52 upstream 86c4d58a99ab 21772ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_write / tty_reopen
* Struck through repros no longer work on HEAD.