================================================================== BUG: KASAN: use-after-free in test_and_set_bit include/asm-generic/bitops-instrumented.h:143 [inline] BUG: KASAN: use-after-free in try_to_grab_pending kernel/workqueue.c:1251 [inline] BUG: KASAN: use-after-free in try_to_grab_pending+0x115/0x910 kernel/workqueue.c:1229 Write of size 8 at addr ffff888091419008 by task syz-executor658/9064 CPU: 1 PID: 9064 Comm: syz-executor658 Not tainted 5.4.0-syzkaller #0 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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192 __kasan_check_write+0x14/0x20 mm/kasan/common.c:101 test_and_set_bit include/asm-generic/bitops-instrumented.h:143 [inline] try_to_grab_pending kernel/workqueue.c:1251 [inline] try_to_grab_pending+0x115/0x910 kernel/workqueue.c:1229 __cancel_work_timer+0xc4/0x540 kernel/workqueue.c:3087 cancel_work_sync+0x18/0x20 kernel/workqueue.c:3164 tty_buffer_cancel_work+0x16/0x20 drivers/tty/tty_buffer.c:613 release_tty+0x261/0x470 drivers/tty/tty_io.c:1520 tty_release_struct+0x3c/0x50 drivers/tty/tty_io.c:1629 tty_release+0xbcb/0xe90 drivers/tty/tty_io.c:1789 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x8e7/0x2ef0 kernel/exit.c:797 do_group_exit+0x135/0x360 kernel/exit.c:895 __do_sys_exit_group kernel/exit.c:906 [inline] __se_sys_exit_group kernel/exit.c:904 [inline] __ia32_sys_exit_group+0x44/0x50 kernel/exit.c:904 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f14a39 Code: Bad RIP value. RSP: 002b:00000000ffed556c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080ed298 RDX: 0000000000000000 RSI: 00000000080d6fdc RDI: 00000000080ed2a0 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 9064: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3551 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:670 [inline] vc_allocate drivers/tty/vt/vt.c:1085 [inline] vc_allocate+0x1fc/0x760 drivers/tty/vt/vt.c:1066 con_install+0x52/0x410 drivers/tty/vt/vt.c:3229 tty_driver_install_tty drivers/tty/tty_io.c:1228 [inline] tty_init_dev drivers/tty/tty_io.c:1341 [inline] tty_init_dev+0xf9/0x470 drivers/tty/tty_io.c:1318 tty_open_by_driver drivers/tty/tty_io.c:1987 [inline] tty_open+0x4a5/0xbb0 drivers/tty/tty_io.c:2035 chrdev_open+0x245/0x6b0 fs/char_dev.c:414 do_dentry_open+0x4e6/0x1380 fs/open.c:797 vfs_open+0xa0/0xd0 fs/open.c:914 do_last fs/namei.c:3420 [inline] path_openat+0x10df/0x4500 fs/namei.c:3537 do_filp_open+0x1a1/0x280 fs/namei.c:3567 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_compat_sys_open fs/open.c:1134 [inline] __se_compat_sys_open fs/open.c:1132 [inline] __ia32_compat_sys_open+0x79/0xb0 fs/open.c:1132 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 9080: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 vt_disallocate_all+0x2bd/0x3e0 drivers/tty/vt/vt_ioctl.c:323 vt_ioctl+0xc38/0x26d0 drivers/tty/vt/vt_ioctl.c:816 vt_compat_ioctl+0x457/0x7a0 drivers/tty/vt/vt_ioctl.c:1232 tty_compat_ioctl+0x1b0/0x420 drivers/tty/tty_io.c:2849 __do_compat_sys_ioctl fs/compat_ioctl.c:214 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:142 [inline] __ia32_compat_sys_ioctl+0x233/0x610 fs/compat_ioctl.c:142 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff888091419000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 8 bytes inside of 2048-byte region [ffff888091419000, ffff888091419800) The buggy address belongs to the page: page:ffffea0002450640 refcount:1 mapcount:0 mapping:ffff8880aa400e00 index:0x0 raw: 00fffe0000000200 ffffea00023b4448 ffffea00029c4c08 ffff8880aa400e00 raw: 0000000000000000 ffff888091419000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888091418f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888091418f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888091419000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888091419080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888091419100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================