bisecting fixing commit since ddef1e8e3f6eb26034833b7255e3fa584d54a230 building syzkaller on af5c522d02400b35a930d6fbdf286f9ce2afc8ba testing commit ddef1e8e3f6eb26034833b7255e3fa584d54a230 with gcc (GCC) 8.1.0 kernel signature: 9121eba02089417c086b67219713d93698d164ba run #0: basic kernel testing failed: failed to copy test binary to VM: failed to run ["scp" "-P" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/jobs/linux/workdir/image/key" "/syzkaller/jobs/linux/workdir/repro.prog" "root@10.128.0.45:./repro.prog"]: exit status 1 Warning: Permanently added '10.128.0.45' (ECDSA) to the list of known hosts. /syzkaller/jobs/linux/workdir/repro.prog: Broken pipe run #1: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #2: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #3: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #4: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #5: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #6: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #7: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #8: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #9: crashed: KASAN: use-after-free Read in relay_switch_subbuf testing current HEAD c1141b3aab36eb0d9b2bcae4aff69e77d0554386 testing commit c1141b3aab36eb0d9b2bcae4aff69e77d0554386 with gcc (GCC) 8.1.0 kernel signature: 32a80957d936e81bf34cbda2226593e36bcc2639 run #0: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #1: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #2: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #3: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #4: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #5: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #6: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #7: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #8: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #9: crashed: KASAN: use-after-free Read in disk_unblock_events revisions tested: 2, total time: 27m11.840592084s (build: 17m6.892066662s, test: 9m28.271304578s) the crash still happens on HEAD commit msg: Linux 4.14.166 crash: KASAN: use-after-free Read in disk_unblock_events devpts: called with bogus options devpts: called with bogus options devpts: called with bogus options ================================================================== devpts: called with bogus options BUG: KASAN: use-after-free in disk_unblock_events+0x42/0x50 block/genhd.c:1644 devpts: called with bogus options Read of size 8 at addr ffff888076fd3988 by task blkid/10904 CPU: 1 PID: 10904 Comm: blkid Not tainted 4.14.166-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 disk_unblock_events+0x42/0x50 block/genhd.c:1644 __blkdev_get+0x738/0x1030 fs/block_dev.c:1556 blkdev_get+0x26d/0x860 fs/block_dev.c:1612 blkdev_open+0x19f/0x200 fs/block_dev.c:1770 do_dentry_open+0x620/0xdb0 fs/open.c:777 vfs_open+0xfc/0x240 fs/open.c:891 do_last fs/namei.c:3425 [inline] path_openat+0xe6d/0x3b50 fs/namei.c:3566 do_filp_open+0x16b/0x220 fs/namei.c:3600 do_sys_open+0x1c2/0x340 fs/open.c:1084 SYSC_open fs/open.c:1102 [inline] SyS_open+0x19/0x20 fs/open.c:1097 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x7f6983788120 RSP: 002b:00007ffd326347f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6983788120 RDX: 00007ffd32635f45 RSI: 0000000000000000 RDI: 00007ffd32635f45 RBP: 0000000000000000 R08: 0000000000000078 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000001dac030 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000005 Allocated by task 10880: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_node_trace+0x14c/0x780 mm/slab.c:3661 kmalloc_node include/linux/slab.h:526 [inline] kzalloc_node include/linux/slab.h:672 [inline] alloc_disk_node+0x5e/0x380 block/genhd.c:1387 alloc_disk+0xe/0x10 block/genhd.c:1371 loop_add+0x3a8/0x810 drivers/block/loop.c:1869 loop_control_ioctl+0x1c9/0x2b0 drivers/block/loop.c:2027 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x180/0xfb0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x74/0x80 fs/ioctl.c:692 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 10904: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 disk_release+0x215/0x290 block/genhd.c:1230 device_release+0xd7/0x170 drivers/base/core.c:823 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x10e/0x1b0 lib/kobject.c:692 put_disk+0x15/0x20 block/genhd.c:1452 __blkdev_get+0x6a5/0x1030 fs/block_dev.c:1549 blkdev_get+0x26d/0x860 fs/block_dev.c:1612 blkdev_open+0x19f/0x200 fs/block_dev.c:1770 do_dentry_open+0x620/0xdb0 fs/open.c:777 vfs_open+0xfc/0x240 fs/open.c:891 do_last fs/namei.c:3425 [inline] path_openat+0xe6d/0x3b50 fs/namei.c:3566 do_filp_open+0x16b/0x220 fs/namei.c:3600 do_sys_open+0x1c2/0x340 fs/open.c:1084 SYSC_open fs/open.c:1102 [inline] SyS_open+0x19/0x20 fs/open.c:1097 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff888076fd3400 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1416 bytes inside of 2048-byte region [ffff888076fd3400, ffff888076fd3c00) The buggy address belongs to the page: page:ffffea0001dbf480 count:1 mapcount:0 mapping:ffff888076fd2300 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff888076fd2300 0000000000000000 0000000100000003 raw: ffffea0002637c20 ffffea000260f7a0 ffff8880aa800c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888076fd3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888076fd3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888076fd3980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888076fd3a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888076fd3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== devpts: called with bogus options