================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x51/0x60 block/genhd.c:1543 Read of size 8 at addr ffff8801d8bb40e8 by task blkid/2856 CPU: 0 PID: 2856 Comm: blkid Not tainted 4.4.162+ #7 0000000000000000 4ee4f871fea24ecd ffff8801d749f6d0 ffffffff81a994bd ffffea000762ec00 ffff8801d8bb40e8 0000000000000000 ffff8801d8bb40e8 0000000000000000 ffff8801d749f708 ffffffff8148a669 ffff8801d8bb40e8 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_address_description+0x6c/0x217 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report.cold.6+0x175/0x2f7 mm/kasan/report.c:408 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] disk_unblock_events+0x51/0x60 block/genhd.c:1543 [] __blkdev_get+0x70c/0xdf0 fs/block_dev.c:1297 [] blkdev_get+0x2da/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1a5/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38d/0xbd0 fs/open.c:749 [] vfs_open+0x12a/0x210 fs/open.c:862 [] do_last fs/namei.c:3222 [inline] [] path_openat+0x50c/0x39a0 fs/namei.c:3359 [] do_filp_open+0x197/0x270 fs/namei.c:3393 [] do_sys_open+0x31c/0x610 fs/open.c:1038 [] SYSC_open fs/open.c:1056 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1051 [] entry_SYSCALL_64_fastpath+0x1e/0x9a Allocated by task 2834: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack mm/kasan/kasan.c:512 [inline] [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:616 [] kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:601 [] kmem_cache_alloc_trace+0x117/0x2d0 mm/slub.c:2642 [] kmem_cache_alloc_node_trace include/linux/slab.h:367 [inline] [] kmalloc_node include/linux/slab.h:514 [inline] [] kzalloc_node include/linux/slab.h:631 [inline] [] alloc_disk_node+0x54/0x3a0 block/genhd.c:1282 [] alloc_disk+0x18/0x20 block/genhd.c:1274 [] loop_add+0x36b/0x7c0 drivers/block/loop.c:1824 [] loop_probe+0x14f/0x180 drivers/block/loop.c:1931 [] kobj_lookup+0x223/0x410 drivers/base/map.c:124 [] get_gendisk+0x39/0x2d0 block/genhd.c:689 [] __blkdev_get+0x39c/0xdf0 fs/block_dev.c:1193 [] blkdev_get+0x488/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1a5/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38d/0xbd0 fs/open.c:749 [] vfs_open+0x12a/0x210 fs/open.c:862 [] do_last fs/namei.c:3222 [inline] [] path_openat+0x50c/0x39a0 fs/namei.c:3359 [] do_filp_open+0x197/0x270 fs/namei.c:3393 [] do_sys_open+0x31c/0x610 fs/open.c:1038 [] C_SYSC_open fs/compat.c:1092 [inline] [] compat_SyS_open+0x2a/0x40 fs/compat.c:1090 [] do_syscall_32_irqs_on arch/x86/entry/common.c:396 [inline] [] do_fast_syscall_32+0x31e/0xa80 arch/x86/entry/common.c:463 [] sysenter_flags_fixed+0xd/0x1a Freed by task 2856: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack mm/kasan/kasan.c:512 [inline] [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:589 [] slab_free_hook mm/slub.c:1383 [inline] [] slab_free_freelist_hook mm/slub.c:1405 [inline] [] slab_free mm/slub.c:2859 [inline] [] kfree+0xf4/0x310 mm/slub.c:3749 [] disk_release+0x259/0x330 block/genhd.c:1118 [] device_release+0x7e/0x220 drivers/base/core.c:247 [] kobject_cleanup lib/kobject.c:643 [inline] [] kobject_release lib/kobject.c:672 [inline] [] kref_sub include/linux/kref.h:73 [inline] [] kref_put include/linux/kref.h:98 [inline] [] kobject_put+0x144/0x260 lib/kobject.c:689 [] put_disk+0x23/0x30 block/genhd.c:1346 [] __blkdev_get+0x66c/0xdf0 fs/block_dev.c:1290 [] blkdev_get+0x2da/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1a5/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38d/0xbd0 fs/open.c:749 [] vfs_open+0x12a/0x210 fs/open.c:862 [] do_last fs/namei.c:3222 [inline] [] path_openat+0x50c/0x39a0 fs/namei.c:3359 [] do_filp_open+0x197/0x270 fs/namei.c:3393 [] do_sys_open+0x31c/0x610 fs/open.c:1038 [] SYSC_open fs/open.c:1056 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1051 [] entry_SYSCALL_64_fastpath+0x1e/0x9a The buggy address belongs to the object at ffff8801d8bb3b80 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8801d8bb3b80, ffff8801d8bb4380) The buggy address belongs to the page: kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 3312 Comm: syz-executor516 Not tainted 4.4.162+ #7 task: ffff8800b1b3df00 task.stack: ffff8800b1b68000 RIP: 0010:[] [] lookup_object lib/debugobjects.c:120 [inline] RIP: 0010:[] [] debug_object_deactivate+0x191/0x340 lib/debugobjects.c:468 RSP: 0018:ffff8801db707ce0 EFLAGS: 00010002 RAX: dffffc0000000000 RBX: 4000000000004080 RCX: 0800000000000813 RDX: 1ffffffff080e713 RSI: ffffffff82eafea0 RDI: 4000000000004098 RBP: ffff8801db707da0 R08: ffff8800b1b3e810 R09: 000000000010a002 R10: ffff8800b1b3df00 R11: 0000000000000001 R12: 1ffff1003b6e0f9e R13: ffffffff84073888 R14: ffff8800b6487d28 R15: 0000000000000003 FS: 0000000000000000(0000) GS:ffff8801db700000(0063) knlGS:000000000958e840 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000080bfdda CR3: 00000000b906d000 CR4: 00000000001606b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: 0000000000000096 ffffffff82eafea0 0000000041b58ab3 ffffffff82c5f17d ffffffff81af8e90 0000000000000046 0000000000000000 ffffffff8125ccbd ffff880000000000 0000000000000000 dffffc0000000000 ffff8800b1b3e7c0 Call Trace: [] debug_hrtimer_deactivate kernel/time/hrtimer.c:415 [inline] [] debug_deactivate kernel/time/hrtimer.c:462 [inline] [] __run_hrtimer kernel/time/hrtimer.c:1230 [inline] [] __hrtimer_run_queues+0x215/0xfc0 kernel/time/hrtimer.c:1325 [] hrtimer_interrupt+0x1b1/0x430 kernel/time/hrtimer.c:1359 [] local_apic_timer_interrupt+0x74/0xa0 arch/x86/kernel/apic/apic.c:901 [] smp_apic_timer_interrupt+0x7c/0xa0 arch/x86/kernel/apic/apic.c:925 [] apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:741 [] spin_unlock_irqrestore include/linux/spinlock.h:362 [inline] [] __wake_up_sync_key+0x4b/0x60 kernel/sched/wait.c:146 [] pipe_write+0x8e8/0xd80 fs/pipe.c:469 [] new_sync_write fs/read_write.c:478 [inline] [] __vfs_write+0x304/0x3e0 fs/read_write.c:491 [] vfs_write+0x17e/0x4e0 fs/read_write.c:538 [] SYSC_write fs/read_write.c:585 [inline] [] SyS_write+0xd9/0x1c0 fs/read_write.c:577 [] do_syscall_32_irqs_on arch/x86/entry/common.c:396 [inline] [] do_fast_syscall_32+0x31e/0xa80 arch/x86/entry/common.c:463 [] sysenter_flags_fixed+0xd/0x1a Code: a9 01 00 00 48 8b 1b 41 bf 01 00 00 00 48 85 db 74 42 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 18 41 83 c7 01 48 89 f9 48 c1 e9 03 <80> 3c 01 00 0f 85 0c 01 00 00 4c 3b 73 18 74 7d 48 89 d9 48 c1 RIP [] lookup_object lib/debugobjects.c:120 [inline] RIP [] debug_object_deactivate+0x191/0x340 lib/debugobjects.c:468 RSP ---[ end trace e932fce4da9a1a5c ]---