pts pts1: tty_release: tty->count(3) != (#fd's(2) + #kopen's(0)) ================================================================== BUG: KASAN: user-memory-access in memset include/linux/string.h:330 [inline] BUG: KASAN: user-memory-access in bitmap_zero include/linux/bitmap.h:208 [inline] BUG: KASAN: user-memory-access in n_tty_set_termios+0x106/0xe80 drivers/tty/n_tty.c:1766 Write of size 512 at addr 0000000000001060 by task syz-executor6/9274 CPU: 0 PID: 9274 Comm: syz-executor6 Not tainted 4.17.0-rc7+ #72 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1b9/0x294 lib/dump_stack.c:113 kasan_report_error mm/kasan/report.c:352 [inline] kasan_report.cold.7+0x6d/0x2fe mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 memset+0x23/0x40 mm/kasan/kasan.c:285 memset include/linux/string.h:330 [inline] bitmap_zero include/linux/bitmap.h:208 [inline] n_tty_set_termios+0x106/0xe80 drivers/tty/n_tty.c:1766 tty_set_termios+0x7a0/0xac0 drivers/tty/tty_ioctl.c:341 set_termios+0x41e/0x7d0 drivers/tty/tty_ioctl.c:414 tty_mode_ioctl+0x855/0xb50 drivers/tty/tty_ioctl.c:749 n_tty_ioctl_helper+0x54/0x3b0 drivers/tty/tty_ioctl.c:940 n_tty_ioctl+0x54/0x320 drivers/tty/n_tty.c:2441 tty_ioctl+0x5e1/0x1870 drivers/tty/tty_io.c:2655 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x1cf/0x16a0 fs/ioctl.c:684 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:701 __do_sys_ioctl fs/ioctl.c:708 [inline] __se_sys_ioctl fs/ioctl.c:706 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:706 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x455a09 RSP: 002b:00007fa9e0507c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fa9e05086d4 RCX: 0000000000455a09 RDX: 00000000200000c0 RSI: 0000000000005402 RDI: 0000000000000015 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000033e R14: 00000000006f8e70 R15: 0000000000000000 ==================================================================