================================================================== BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:70 [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+0x112/0x8e0 kernel/workqueue.c:1229 Write of size 8 at addr ffff888098b69008 by task syz-executor362/9522 CPU: 1 PID: 9522 Comm: syz-executor362 Not tainted 5.6.0-rc3-next-20200228-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+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:374 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:618 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x128/0x190 mm/kasan/generic.c:192 instrument_atomic_write include/linux/instrumented.h:71 [inline] test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:70 [inline] try_to_grab_pending kernel/workqueue.c:1251 [inline] try_to_grab_pending+0x112/0x8e0 kernel/workqueue.c:1229 __cancel_work_timer+0xa6/0x500 kernel/workqueue.c:3089 release_tty+0x253/0x450 drivers/tty/tty_io.c:1520 tty_release_struct+0x37/0x50 drivers/tty/tty_io.c:1629 tty_release+0xbc7/0xe90 drivers/tty/tty_io.c:1789 __fput+0x2da/0x850 fs/file_table.c:280 task_work_run+0x13f/0x1b0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xb53/0x2e10 kernel/exit.c:802 do_group_exit+0x125/0x340 kernel/exit.c:900 __do_sys_exit_group kernel/exit.c:911 [inline] __se_sys_exit_group kernel/exit.c:909 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:909 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x43ff38 Code: Bad RIP value. RSP: 002b:00007ffc1322c528 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043ff38 RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 RBP: 00000000004bf950 R08: 00000000000000e7 R09: ffffffffffffffd0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00000000006d2180 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 9522: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc mm/kasan/common.c:492 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:465 kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] vc_allocate drivers/tty/vt/vt.c:1097 [inline] vc_allocate+0x1e2/0x6e0 drivers/tty/vt/vt.c:1078 con_install+0x4f/0x400 drivers/tty/vt/vt.c:3241 tty_driver_install_tty drivers/tty/tty_io.c:1228 [inline] tty_init_dev drivers/tty/tty_io.c:1341 [inline] tty_init_dev+0xf5/0x460 drivers/tty/tty_io.c:1318 tty_open_by_driver drivers/tty/tty_io.c:1987 [inline] tty_open+0x47f/0xb30 drivers/tty/tty_io.c:2035 chrdev_open+0x219/0x5c0 fs/char_dev.c:414 do_dentry_open+0x49e/0x1250 fs/open.c:797 do_last fs/namei.c:3490 [inline] path_openat+0x122a/0x3230 fs/namei.c:3607 do_filp_open+0x192/0x260 fs/namei.c:3637 do_sys_openat2+0x54c/0x740 fs/open.c:1149 do_sys_open+0xc3/0x140 fs/open.c:1165 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9517: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:314 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:453 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 vt_disallocate_all+0x283/0x370 drivers/tty/vt/vt_ioctl.c:338 vt_ioctl+0x79e/0x2450 drivers/tty/vt/vt_ioctl.c:831 tty_ioctl+0xedd/0x1440 drivers/tty/tty_io.c:2660 vfs_ioctl fs/ioctl.c:47 [inline] ksys_ioctl+0x11a/0x180 fs/ioctl.c:763 __do_sys_ioctl fs/ioctl.c:772 [inline] __se_sys_ioctl fs/ioctl.c:770 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:770 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888098b69000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 8 bytes inside of 2048-byte region [ffff888098b69000, ffff888098b69800) The buggy address belongs to the page: page:ffffea000262da40 refcount:1 mapcount:0 mapping:00000000355ac533 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00023e5f08 ffffea0002514d88 ffff8880aa000e00 raw: 0000000000000000 ffff888098b69000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888098b68f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ffff888098b68f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888098b69000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888098b69080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888098b69100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================