bisecting fixing commit since b0d4beaa5a4b7d31070c41c2e50740304a3f1138 building syzkaller on 98b4ef2d37d8a54ac96f1b117764446945e46505 testing commit b0d4beaa5a4b7d31070c41c2e50740304a3f1138 with gcc (GCC) 8.1.0 kernel signature: f14efc8249b329865c9fd6d80aaf5f1e13646c934f16a5d926cbfca88e845f41 run #0: crashed: KASAN: use-after-free Read in soft_cursor run #1: crashed: KASAN: slab-out-of-bounds 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: use-after-free Read in soft_cursor run #8: crashed: KASAN: use-after-free Read in soft_cursor run #9: crashed: KASAN: slab-out-of-bounds Read in soft_cursor testing current HEAD 5cf9ad0e6b164a90581a59609dbf5bda3f5a089c testing commit 5cf9ad0e6b164a90581a59609dbf5bda3f5a089c with gcc (GCC) 8.1.0 kernel signature: 2ede11e42e0563da74aaac50e26e0afe706cd2260403da3a91451fadc79f9e8a all runs: crashed: KASAN: use-after-free Read in soft_cursor revisions tested: 2, total time: 23m4.556333667s (build: 12m50.324705727s, test: 9m51.614548359s) the crash still happens on HEAD commit msg: Merge tag 'io_uring-5.5-2020-01-26' of git://git.kernel.dk/linux-block crash: KASAN: use-after-free Read in soft_cursor ================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:380 [inline] BUG: KASAN: use-after-free in soft_cursor+0x430/0xc70 drivers/video/fbdev/core/softcursor.c:70 Read of size 9 at addr ffff88809de59451 by task syz-executor.3/8579 CPU: 0 PID: 8579 Comm: syz-executor.3 Not tainted 5.5.0-rc7-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+0x12d/0x187 lib/dump_stack.c:118 print_address_description.constprop.8.cold.10+0x9/0x31d mm/kasan/report.c:374 __kasan_report.cold.11+0x1b/0x3a 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+0x153/0x1d0 mm/kasan/generic.c:192 memcpy+0x23/0x50 mm/kasan/common.c:125 memcpy include/linux/string.h:380 [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+0x3db/0x570 drivers/video/fbdev/core/fbcon.c:1402 hide_cursor+0x97/0x260 drivers/tty/vt/vt.c:895 redraw_screen+0x4e6/0x720 drivers/tty/vt/vt.c:988 vc_do_resize+0xf01/0x12d0 drivers/tty/vt/vt.c:1284 vc_resize+0x3d/0x60 drivers/tty/vt/vt.c:1304 vt_ioctl+0xf31/0x21f0 drivers/tty/vt/vt_ioctl.c:887 tty_ioctl+0x45b/0x12f0 drivers/tty/tty_io.c:2660 vfs_ioctl fs/ioctl.c:47 [inline] file_ioctl fs/ioctl.c:545 [inline] do_vfs_ioctl+0x196/0x1190 fs/ioctl.c:732 ksys_ioctl+0x62/0x90 fs/ioctl.c:749 __do_sys_ioctl fs/ioctl.c:756 [inline] __se_sys_ioctl fs/ioctl.c:754 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:754 do_syscall_64+0xca/0x5f0 arch/x86/entry/common.c:294 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:00007f1dbe872c78 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: 00007f1dbe8736d4 R13: 00000000004c6ce2 R14: 00000000004dd2d0 R15: 00000000ffffffff Allocated by task 8570: save_stack+0x21/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc.constprop.17+0xc7/0xd0 mm/kasan/common.c:513 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x164/0x790 mm/slab.c:3665 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:670 [inline] tomoyo_init_log+0x1146/0x1de0 security/tomoyo/audit.c:275 tomoyo_supervisor+0x30a/0xc00 security/tomoyo/common.c:2097 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x3ca/0x4c0 security/tomoyo/file.c:734 tomoyo_file_ioctl+0x14/0x20 security/tomoyo/tomoyo.c:335 security_file_ioctl+0x4a/0x90 security/security.c:1409 ksys_ioctl+0x39/0x90 fs/ioctl.c:747 __do_sys_ioctl fs/ioctl.c:756 [inline] __se_sys_ioctl fs/ioctl.c:754 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:754 do_syscall_64+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8570: save_stack+0x21/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+0x108/0x2c0 mm/slab.c:3757 tomoyo_supervisor+0x326/0xc00 security/tomoyo/common.c:2149 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x3ca/0x4c0 security/tomoyo/file.c:734 tomoyo_file_ioctl+0x14/0x20 security/tomoyo/tomoyo.c:335 security_file_ioctl+0x4a/0x90 security/security.c:1409 ksys_ioctl+0x39/0x90 fs/ioctl.c:747 __do_sys_ioctl fs/ioctl.c:756 [inline] __se_sys_ioctl fs/ioctl.c:754 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:754 do_syscall_64+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809de59400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 81 bytes inside of 512-byte region [ffff88809de59400, ffff88809de59600) The buggy address belongs to the page: page:ffffea0002779640 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0 raw: 00fffe0000000200 ffffea000250e848 ffffea00029bb7c8 ffff8880aa400a80 raw: 0000000000000000 ffff88809de59000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809de59300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809de59380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809de59400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809de59480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809de59500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================