================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x4b/0x50 syzkaller/managers/linux-4-14/kernel/block/genhd.c:1647 Read of size 8 at addr ffff8880af01b108 by task syz-executor.0/7998 CPU: 1 PID: 7998 Comm: syz-executor.0 Not tainted 4.14.218-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 syzkaller/managers/linux-4-14/kernel/mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 syzkaller/managers/linux-4-14/kernel/mm/kasan/report.c:351 kasan_report syzkaller/managers/linux-4-14/kernel/mm/kasan/report.c:409 [inline] __asan_report_load8_noabort+0x68/0x70 syzkaller/managers/linux-4-14/kernel/mm/kasan/report.c:430 disk_unblock_events+0x4b/0x50 syzkaller/managers/linux-4-14/kernel/block/genhd.c:1647 __blkdev_get+0x83b/0x1090 syzkaller/managers/linux-4-14/kernel/fs/block_dev.c:1556 blkdev_get+0x88/0x890 syzkaller/managers/linux-4-14/kernel/fs/block_dev.c:1611 blkdev_open+0x1cc/0x250 syzkaller/managers/linux-4-14/kernel/fs/block_dev.c:1772 do_dentry_open+0x44b/0xec0 syzkaller/managers/linux-4-14/kernel/fs/open.c:777 vfs_open+0x105/0x220 syzkaller/managers/linux-4-14/kernel/fs/open.c:888 do_last syzkaller/managers/linux-4-14/kernel/fs/namei.c:3428 [inline] path_openat+0x628/0x2970 syzkaller/managers/linux-4-14/kernel/fs/namei.c:3569 do_filp_open+0x179/0x3c0 syzkaller/managers/linux-4-14/kernel/fs/namei.c:3603 do_sys_open+0x296/0x410 syzkaller/managers/linux-4-14/kernel/fs/open.c:1081 do_syscall_64+0x1d5/0x640 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x4190f4 RSP: 002b:00007ffdc2870240 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007ffdc2870350 RCX: 00000000004190f4 RDX: 0000000000000002 RSI: 00007ffdc2870390 RDI: 00000000ffffff9c RBP: 00007ffdc2870390 R08: 0000000000000000 R09: 00007ffdc2870150 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002 R13: 000000000015eedd R14: 0000000000000000 R15: 00007ffdc2870390 Allocated by task 13501: save_stack syzkaller/managers/linux-4-14/kernel/mm/kasan/kasan.c:447 [inline] set_track syzkaller/managers/linux-4-14/kernel/mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 syzkaller/managers/linux-4-14/kernel/mm/kasan/kasan.c:551 kmem_cache_alloc_node_trace+0x153/0x400 syzkaller/managers/linux-4-14/kernel/mm/slab.c:3661 kmalloc_node syzkaller/managers/linux-4-14/kernel/./include/linux/slab.h:526 [inline] kzalloc_node syzkaller/managers/linux-4-14/kernel/./include/linux/slab.h:672 [inline] alloc_disk_node+0x5d/0x3d0 syzkaller/managers/linux-4-14/kernel/block/genhd.c:1390 loop_add+0x3cb/0x830 syzkaller/managers/linux-4-14/kernel/drivers/block/loop.c:1869 loop_control_ioctl+0x11a/0x3f0 syzkaller/managers/linux-4-14/kernel/drivers/block/loop.c:2001 vfs_ioctl syzkaller/managers/linux-4-14/kernel/fs/ioctl.c:46 [inline] file_ioctl syzkaller/managers/linux-4-14/kernel/fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 syzkaller/managers/linux-4-14/kernel/fs/ioctl.c:684 SYSC_ioctl syzkaller/managers/linux-4-14/kernel/fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 syzkaller/managers/linux-4-14/kernel/fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 7998: save_stack syzkaller/managers/linux-4-14/kernel/mm/kasan/kasan.c:447 [inline] set_track syzkaller/managers/linux-4-14/kernel/mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 syzkaller/managers/linux-4-14/kernel/mm/kasan/kasan.c:524 __cache_free syzkaller/managers/linux-4-14/kernel/mm/slab.c:3496 [inline] kfree+0xc9/0x250 syzkaller/managers/linux-4-14/kernel/mm/slab.c:3815 device_release+0xf0/0x1a0 syzkaller/managers/linux-4-14/kernel/drivers/base/core.c:831 kobject_cleanup syzkaller/managers/linux-4-14/kernel/lib/kobject.c:646 [inline] kobject_release syzkaller/managers/linux-4-14/kernel/lib/kobject.c:675 [inline] kref_put syzkaller/managers/linux-4-14/kernel/./include/linux/kref.h:70 [inline] kobject_put+0x251/0x550 syzkaller/managers/linux-4-14/kernel/lib/kobject.c:692 put_disk+0x1f/0x30 syzkaller/managers/linux-4-14/kernel/block/genhd.c:1455 __blkdev_get+0x7a6/0x1090 syzkaller/managers/linux-4-14/kernel/fs/block_dev.c:1549 blkdev_get+0x88/0x890 syzkaller/managers/linux-4-14/kernel/fs/block_dev.c:1611 blkdev_open+0x1cc/0x250 syzkaller/managers/linux-4-14/kernel/fs/block_dev.c:1772 do_dentry_open+0x44b/0xec0 syzkaller/managers/linux-4-14/kernel/fs/open.c:777 vfs_open+0x105/0x220 syzkaller/managers/linux-4-14/kernel/fs/open.c:888 do_last syzkaller/managers/linux-4-14/kernel/fs/namei.c:3428 [inline] path_openat+0x628/0x2970 syzkaller/managers/linux-4-14/kernel/fs/namei.c:3569 do_filp_open+0x179/0x3c0 syzkaller/managers/linux-4-14/kernel/fs/namei.c:3603 do_sys_open+0x296/0x410 syzkaller/managers/linux-4-14/kernel/fs/open.c:1081 do_syscall_64+0x1d5/0x640 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880af01ab80 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1416 bytes inside of 2048-byte region [ffff8880af01ab80, ffff8880af01b380) The buggy address belongs to the page: page:ffffea0002bc0680 count:1 mapcount:0 mapping:ffff8880af01a300 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffff8880af01a300 0000000000000000 0000000100000003 raw: ffffea00028cc2a0 ffffea0001df52a0 ffff88813fe80c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880af01b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880af01b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880af01b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880af01b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880af01b200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================