executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program syzkaller login: [ 17.731681] ================================================================== [ 17.732459] BUG: KASAN: use-after-free in disk_unblock_events+0x51/0x60 [ 17.733702] Read of size 8 at addr ffff88006d378b40 by task blkid/3172 executing program [ 17.734266] executing program [ 17.735129] CPU: 0 PID: 3172 Comm: blkid Not tainted 4.14.0-rc5-next-20171018+ #8 [ 17.740167] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 17.740836] Call Trace: [ 17.741069] dump_stack+0x194/0x257 [ 17.741427] ? arch_local_irq_restore+0x53/0x53 [ 17.741913] ? show_regs_print_info+0x65/0x65 [ 17.742369] ? kfree_const+0x31/0x40 [ 17.742749] ? disk_unblock_events+0x51/0x60 [ 17.743156] print_address_description+0x73/0x250 [ 17.743529] ? disk_unblock_events+0x51/0x60 [ 17.743888] kasan_report+0x25b/0x340 [ 17.744188] __asan_report_load8_noabort+0x14/0x20 [ 17.744559] disk_unblock_events+0x51/0x60 [ 17.744908] __blkdev_get+0x78d/0xf90 [ 17.745219] ? __blkdev_put+0x7c0/0x7c0 [ 17.745536] blkdev_get+0x3a1/0xad0 [ 17.746174] ? do_raw_spin_trylock+0x190/0x190 [ 17.746623] ? bd_link_disk_holder+0x8b0/0x8b0 [ 17.747021] ? __fsnotify_parent+0xb4/0x3a0 [ 17.747407] ? errseq_sample+0xee/0x140 [ 17.747689] ? _copy_to_user+0xc0/0xc0 [ 17.748010] ? _raw_spin_unlock+0x22/0x30 [ 17.748413] blkdev_open+0x1c9/0x250 [ 17.748669] ? security_file_open+0x89/0x190 [ 17.748953] do_dentry_open+0x664/0xd40 [ 17.749232] ? security_inode_permission+0xbb/0xf0 [ 17.749686] ? bd_acquire+0x2c0/0x2c0 [ 17.750293] vfs_open+0x107/0x220 [ 17.750559] path_openat+0x1151/0x3520 [ 17.750874] ? path_lookupat+0xba0/0xba0 [ 17.751190] ? lock_downgrade+0x990/0x990 [ 17.751525] ? do_sys_open+0x2e7/0x6d0 [ 17.751885] ? do_raw_spin_trylock+0x190/0x190 [ 17.752311] ? find_held_lock+0x35/0x1d0 [ 17.752625] ? __lock_is_held+0xb6/0x140 [ 17.752931] ? _find_next_bit+0xee/0x120 [ 17.753242] ? _raw_spin_unlock+0x22/0x30 [ 17.753565] ? __alloc_fd+0x29b/0x750 [ 17.753884] do_filp_open+0x25b/0x3b0 [ 17.754176] ? may_open_dev+0xe0/0xe0 [ 17.754469] ? mpi_resize+0x200/0x200 [ 17.754755] ? get_unused_fd_flags+0x121/0x190 [ 17.755093] ? getname_flags+0x256/0x580 [ 17.755401] do_sys_open+0x502/0x6d0 [ 17.755671] ? do_sys_open+0x502/0x6d0 [ 17.755958] ? filp_open+0x70/0x70 [ 17.756224] ? entry_SYSCALL_64_fastpath+0x5/0xbe [ 17.756579] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 17.756948] SyS_open+0x2d/0x40 [ 17.757195] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 17.757546] RIP: 0033:0x7f429a253120 [ 17.757832] RSP: 002b:00007ffd02d12378 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 [ 17.758473] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f429a253120 [ 17.759007] RDX: 00007ffd02d12f45 RSI: 0000000000000000 RDI: 00007ffd02d12f45 [ 17.759565] RBP: 0000000000000082 R08: 0000000000000078 R09: 0000000000000000 [ 17.760128] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000166f030 [ 17.760729] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000005 [ 17.761358] [ 17.761497] Allocated by task 3165: [ 17.761928] save_stack+0x43/0xd0 [ 17.762721] kasan_kmalloc+0xad/0xe0 [ 17.763062] kmem_cache_alloc_node_trace+0x150/0x750 [ 17.763541] alloc_disk_node+0xb4/0x4e0 [ 17.763889] alloc_disk+0x18/0x20 [ 17.764182] loop_add+0x45c/0xa50 [ 17.764530] loop_probe+0x16d/0x1a0 [ 17.764900] kobj_lookup+0x2ac/0x410 [ 17.765262] get_gendisk+0x37/0x230 [ 17.765612] blkdev_get+0x12d/0xad0 [ 17.765987] blkdev_open+0x1c9/0x250 [ 17.766340] do_dentry_open+0x664/0xd40 [ 17.766709] vfs_open+0x107/0x220 [ 17.767032] path_openat+0x1151/0x3520 [ 17.767423] do_filp_open+0x25b/0x3b0 [ 17.767773] do_sys_open+0x502/0x6d0 [ 17.768135] SyS_open+0x2d/0x40 [ 17.768485] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 17.768928] [ 17.769097] Freed by task 3172: executing program [ 17.769425] save_stack+0x43/0xd0 [ 17.769770] kasan_slab_free+0x71/0xc0 [ 17.770402] kfree+0xca/0x250 [ 17.770667] disk_release+0x327/0x410 [ 17.771009] device_release+0x7c/0x200 [ 17.771267] kobject_put+0x14c/0x240 [ 17.771558] put_disk+0x23/0x30 [ 17.771890] __blkdev_get+0x6ed/0xf90 [ 17.772260] blkdev_get+0x3a1/0xad0 [ 17.772544] blkdev_open+0x1c9/0x250 [ 17.772768] do_dentry_open+0x664/0xd40 [ 17.773009] vfs_open+0x107/0x220 [ 17.773223] path_openat+0x1151/0x3520 [ 17.773536] do_filp_open+0x25b/0x3b0 [ 17.773773] do_sys_open+0x502/0x6d0 [ 17.774041] SyS_open+0x2d/0x40 [ 17.774321] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 17.774755] [ 17.774864] The buggy address belongs to the object at ffff88006d3785c0 [ 17.774864] which belongs to the cache kmalloc-2048 of size 2048 [ 17.775735] The buggy address is located 1408 bytes inside of [ 17.775735] 2048-byte region [ffff88006d3785c0, ffff88006d378dc0) [ 17.776466] The buggy address belongs to the page: [ 17.776848] page:ffffea0001b4de00 count:1 mapcount:0 mapping:ffff88006d3785c0 index:0x0 compound_mapcount: 0 [ 17.777458] flags: 0x500000000008100(slab|head) [ 17.777795] raw: 0500000000008100 ffff88006d3785c0 0000000000000000 0000000100000003 [ 17.778441] raw: ffffea0001b46920 ffffea0001a322a0 ffff88003e800c40 0000000000000000 [ 17.779262] page dumped because: kasan: bad access detected [ 17.779704] [ 17.779822] Memory state around the buggy address: [ 17.780226] ffff88006d378a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 17.780965] ffff88006d378a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 17.781591] >ffff88006d378b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 17.782269] ^ [ 17.782777] ffff88006d378b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 17.783332] ffff88006d378c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 17.783875] ================================================================== [ 17.784425] Disabling lock debugging due to kernel taint [ 17.784919] Kernel panic - not syncing: panic_on_warn set ... [ 17.784919] [ 17.785483] CPU: 0 PID: 3172 Comm: blkid Tainted: G B 4.14.0-rc5-next-20171018+ #8 [ 17.786161] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 17.786776] Call Trace: [ 17.786973] dump_stack+0x194/0x257 [ 17.787243] ? arch_local_irq_restore+0x53/0x53 executing program [ 17.787588] ? kasan_end_report+0x32/0x50 [ 17.787995] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 17.788348] ? vsnprintf+0x1ed/0x1900 [ 17.788629] ? disk_unblock_events+0x50/0x60 [ 17.788953] panic+0x1e4/0x41c [ 17.789189] ? refcount_error_report+0x214/0x214 [ 17.789543] ? add_taint+0x1c/0x50 [ 17.789804] ? add_taint+0x1c/0x50 [ 17.790132] ? disk_unblock_events+0x51/0x60 [ 17.790534] kasan_end_report+0x50/0x50 [ 17.790893] kasan_report+0x144/0x340 [ 17.791240] __asan_report_load8_noabort+0x14/0x20 [ 17.791685] disk_unblock_events+0x51/0x60 [ 17.792071] __blkdev_get+0x78d/0xf90 [ 17.792409] ? __blkdev_put+0x7c0/0x7c0 [ 17.792707] blkdev_get+0x3a1/0xad0 [ 17.792978] ? do_raw_spin_trylock+0x190/0x190 [ 17.793345] ? bd_link_disk_holder+0x8b0/0x8b0 [ 17.793681] ? __fsnotify_parent+0xb4/0x3a0 [ 17.794012] ? errseq_sample+0xee/0x140 [ 17.794315] ? _copy_to_user+0xc0/0xc0 [ 17.794616] ? _raw_spin_unlock+0x22/0x30 [ 17.794935] blkdev_open+0x1c9/0x250 [ 17.795218] ? security_file_open+0x89/0x190 [ 17.795547] do_dentry_open+0x664/0xd40 [ 17.795839] ? security_inode_permission+0xbb/0xf0 [ 17.796198] ? bd_acquire+0x2c0/0x2c0 [ 17.796482] vfs_open+0x107/0x220 [ 17.796738] path_openat+0x1151/0x3520 [ 17.797380] ? path_lookupat+0xba0/0xba0 [ 17.797676] ? lock_downgrade+0x990/0x990 [ 17.798015] ? do_sys_open+0x2e7/0x6d0 [ 17.798381] ? do_raw_spin_trylock+0x190/0x190 [ 17.798804] ? find_held_lock+0x35/0x1d0 [ 17.799172] ? __lock_is_held+0xb6/0x140 [ 17.799487] ? _find_next_bit+0xee/0x120 [ 17.799787] ? _raw_spin_unlock+0x22/0x30 [ 17.800092] ? __alloc_fd+0x29b/0x750 [ 17.800389] do_filp_open+0x25b/0x3b0 [ 17.800669] ? may_open_dev+0xe0/0xe0 [ 17.800952] ? mpi_resize+0x200/0x200 [ 17.801232] ? get_unused_fd_flags+0x121/0x190 [ 17.801571] ? getname_flags+0x256/0x580 [ 17.801879] do_sys_open+0x502/0x6d0 [ 17.802158] ? do_sys_open+0x502/0x6d0 [ 17.802456] ? filp_open+0x70/0x70 [ 17.802723] ? entry_SYSCALL_64_fastpath+0x5/0xbe [ 17.803111] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 17.803526] SyS_open+0x2d/0x40 [ 17.803786] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 17.804144] RIP: 0033:0x7f429a253120 [ 17.804454] RSP: 002b:00007ffd02d12378 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 [ 17.805103] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f429a253120 [ 17.805704] RDX: 00007ffd02d12f45 RSI: 0000000000000000 RDI: 00007ffd02d12f45 [ 17.806366] RBP: 0000000000000082 R08: 0000000000000078 R09: 0000000000000000 [ 17.806943] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000166f030 executing program [ 17.807559] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000005 [ 17.813188] Dumping ftrace buffer: [ 17.813474] (ftrace buffer empty) [ 17.813770] Kernel Offset: disabled [ 17.814113] Rebooting in 86400 seconds..