syzbot


KCSAN: data-race in n_tty_poll / tty_set_termios (8)

Status: moderation: reported on 2024/12/09 09:54
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+f4d617d875e468233ebd@syzkaller.appspotmail.com
First crash: 12d, last: 4d08h
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in n_tty_poll / tty_set_termios (4) serial 1 1076d 1076d 0/28 auto-closed as invalid on 2022/02/14 10:19
upstream KCSAN: data-race in n_tty_poll / tty_set_termios (6) serial 1 323d 323d 0/28 auto-obsoleted due to no activity on 2024/03/08 03:04
upstream KCSAN: data-race in n_tty_poll / tty_set_termios (2) serial 2 1267d 1301d 0/28 auto-closed as invalid on 2021/08/07 13:54
upstream KCSAN: data-race in n_tty_poll / tty_set_termios (7) serial 1 147d 147d 0/28 auto-obsoleted due to no activity on 2024/08/31 07:27
upstream KCSAN: data-race in n_tty_poll / tty_set_termios serial 1 1344d 1344d 0/28 auto-closed as invalid on 2021/05/22 11:20
upstream KCSAN: data-race in n_tty_poll / tty_set_termios (5) serial 1 466d 466d 0/28 auto-obsoleted due to no activity on 2023/10/17 08:33
upstream KCSAN: data-race in n_tty_poll / tty_set_termios (3) serial 1 1157d 1157d 0/28 auto-closed as invalid on 2021/11/25 02:42

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

write to 0xffff88814018991f of 1 bytes by task 32097 on cpu 0:
 unset_locked_termios drivers/tty/tty_ioctl.c:220 [inline]
 tty_set_termios+0x3ee/0x8b0 drivers/tty/tty_ioctl.c:340
 set_termios+0x497/0x4e0 drivers/tty/tty_ioctl.c:516
 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 0xffff88814018991f of 1 bytes by task 32096 on cpu 1:
 input_available_p drivers/tty/n_tty.c:1937 [inline]
 n_tty_poll+0x256/0x490 drivers/tty/n_tty.c:2468
 tty_poll+0x78/0xf0 drivers/tty/tty_io.c:2208
 vfs_poll include/linux/poll.h:84 [inline]
 __io_arm_poll_handler+0x1e5/0xd50 io_uring/poll.c:578
 io_arm_poll_handler+0x3f6/0x5b0 io_uring/poll.c:706
 io_queue_async+0x89/0x320 io_uring/io_uring.c:1924
 io_queue_sqe io_uring/io_uring.c:1953 [inline]
 io_submit_sqe io_uring/io_uring.c:2201 [inline]
 io_submit_sqes+0x9f3/0x1090 io_uring/io_uring.c:2318
 __do_sys_io_uring_enter io_uring/io_uring.c:3390 [inline]
 __se_sys_io_uring_enter+0x1b9/0x1ba0 io_uring/io_uring.c:3325
 __x64_sys_io_uring_enter+0x78/0x90 io_uring/io_uring.c:3325
 x64_sys_call+0xb5e/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:427
 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: 0x01 -> 0x33

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 32096 Comm: syz.2.7846 Not tainted 6.13.0-rc3-syzkaller-00017-gf44d154d6e3d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/17 05:59 upstream f44d154d6e3d eec85da6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_poll / tty_set_termios
2024/12/09 09:54 upstream fac04efc5c79 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in n_tty_poll / tty_set_termios
* Struck through repros no longer work on HEAD.