bisecting fixing commit since 174651bdf802a2139065e8e31ce950e2f3fc4a94 building syzkaller on 0ecb9746a701be4544b845514a31a21cce92cc79 testing commit 174651bdf802a2139065e8e31ce950e2f3fc4a94 with gcc (GCC) 8.1.0 kernel signature: 8e1805da32c24e2ed2163a3824c4ed05f7d3a06c59c5b0d6d620fb1fd73de304 run #0: crashed: KASAN: use-after-free Read in soft_cursor run #1: crashed: KASAN: use-after-free Read in soft_cursor run #2: crashed: KASAN: use-after-free Read in soft_cursor run #3: crashed: KASAN: slab-out-of-bounds Read in soft_cursor run #4: crashed: KASAN: use-after-free Read in soft_cursor run #5: crashed: KASAN: use-after-free Read in soft_cursor run #6: crashed: KASAN: use-after-free Read in soft_cursor run #7: crashed: KASAN: slab-out-of-bounds Read in bit_putcs run #8: crashed: KASAN: use-after-free Read in soft_cursor run #9: crashed: KASAN: use-after-free Read in soft_cursor testing current HEAD 8488c3f3bc867e4422bf00b303d7d1fbe829d528 testing commit 8488c3f3bc867e4422bf00b303d7d1fbe829d528 with gcc (GCC) 8.1.0 kernel signature: 0b4006990dcaded3927765e2b754f2210a179f7ae9f4606b74e95a73063a88fa run #0: crashed: KASAN: slab-out-of-bounds Read in soft_cursor run #1: crashed: KASAN: use-after-free Read in soft_cursor run #2: crashed: KASAN: slab-out-of-bounds Read in soft_cursor run #3: crashed: KASAN: use-after-free Read in soft_cursor run #4: crashed: KASAN: use-after-free Read in soft_cursor run #5: crashed: KASAN: use-after-free Read in soft_cursor run #6: crashed: KASAN: slab-out-of-bounds Read in soft_cursor run #7: crashed: KASAN: use-after-free Read in soft_cursor run #8: crashed: KASAN: use-after-free Read in soft_cursor run #9: crashed: KASAN: use-after-free Read in soft_cursor revisions tested: 2, total time: 26m2.008801581s (build: 18m22.756972618s, test: 6m15.927962419s) the crash still happens on HEAD commit msg: Linux 4.19.116 crash: KASAN: use-after-free Read in soft_cursor IPv6: ADDRCONF(NETDEV_CHANGE): team_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:348 [inline] BUG: KASAN: use-after-free in soft_cursor+0x430/0xc70 drivers/video/fbdev/core/softcursor.c:70 Read of size 9 at addr ffff88809422c6d1 by task syz-executor.5/7419 CPU: 0 PID: 7419 Comm: syz-executor.5 Not tainted 4.19.116-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+0x123/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 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 memcpy+0x23/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:348 [inline] soft_cursor+0x430/0xc70 drivers/video/fbdev/core/softcursor.c:70 bit_cursor+0xce1/0x22e0 drivers/video/fbdev/core/bitblit.c:386 fbcon_cursor+0x3d8/0x6c0 drivers/video/fbdev/core/fbcon.c:1372 hide_cursor+0x73/0x2b0 drivers/tty/vt/vt.c:896 redraw_screen+0x287/0x820 drivers/tty/vt/vt.c:1000 vc_do_resize+0xf35/0x1310 drivers/tty/vt/vt.c:1311 vc_resize+0x3d/0x60 drivers/tty/vt/vt.c:1331 vt_ioctl+0xfc0/0x2380 drivers/tty/vt/vt_ioctl.c:901 tty_ioctl+0x452/0x1290 drivers/tty/tty_io.c:2669 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a679 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1f8cb43c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a679 RDX: 00000000200002c0 RSI: 000000000000560a RDI: 0000000000000004 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1f8cb446d4 R13: 00000000004c6ce2 R14: 00000000004dd2d0 R15: 00000000ffffffff Allocated by task 3669: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x740 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] kernfs_fop_open+0x21d/0xc00 fs/kernfs/file.c:648 do_dentry_open+0x3f1/0x1010 fs/open.c:796 vfs_open+0x9a/0xc0 fs/open.c:902 do_last fs/namei.c:3421 [inline] path_openat+0x6fa/0x3c60 fs/namei.c:3537 do_filp_open+0x177/0x250 fs/namei.c:3567 do_sys_open+0x1dd/0x350 fs/open.c:1085 __do_sys_open fs/open.c:1103 [inline] __se_sys_open fs/open.c:1098 [inline] __x64_sys_open+0x79/0xb0 fs/open.c:1098 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 3669: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 kernfs_fop_release+0x10a/0x170 fs/kernfs/file.c:783 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x1a9/0x200 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x413/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809422c500 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 465 bytes inside of 512-byte region [ffff88809422c500, ffff88809422c700) The buggy address belongs to the page: page:ffffea0002508b00 count:1 mapcount:0 mapping:ffff88812c29c940 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea000252efc8 ffffea00021a9b08 ffff88812c29c940 raw: 0000000000000000 ffff88809422c000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809422c580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809422c600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809422c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809422c700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809422c780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================