================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x4b/0x50 block/genhd.c:1644 Read of size 8 at addr ffff8881d7248de8 by task syz-executor550/4046 CPU: 0 PID: 4046 Comm: syz-executor550 Not tainted 4.14.85+ #15 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x11b lib/dump_stack.c:53 print_address_description+0x60/0x22b mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409 disk_unblock_events+0x4b/0x50 block/genhd.c:1644 __blkdev_get+0x68f/0xe50 fs/block_dev.c:1548 blkdev_get+0x97/0x8c0 fs/block_dev.c:1604 blkdev_open+0x1bd/0x240 fs/block_dev.c:1762 do_dentry_open+0x426/0xda0 fs/open.c:764 vfs_open+0x11c/0x210 fs/open.c:878 do_last fs/namei.c:3455 [inline] path_openat+0x5f9/0x2930 fs/namei.c:3597 do_filp_open+0x197/0x270 fs/namei.c:3631 do_sys_open+0x2ef/0x580 fs/open.c:1071 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x405991 RSP: 002b:00007f5f72cd2970 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000405991 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007f5f72cd2980 RBP: 6666666666666667 R08: 000000000000000f R09: 00007f5f72cd3700 R10: 00007f5f72cd39d0 R11: 0000000000000293 R12: 0000000000000000 R13: 6f6f6c2f7665642f R14: 6f72746e6f632d70 R15: 00000000006dcd2c Allocated by task 4036: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x138/0x300 mm/slub.c:2750 kmem_cache_alloc_node_trace include/linux/slab.h:378 [inline] kmalloc_node include/linux/slab.h:526 [inline] kzalloc_node include/linux/slab.h:672 [inline] alloc_disk_node+0x5f/0x3b0 block/genhd.c:1387 loop_add+0x3e9/0x840 drivers/block/loop.c:1827 loop_probe+0x14f/0x180 drivers/block/loop.c:1934 kobj_lookup+0x230/0x420 drivers/base/map.c:124 get_gendisk+0x32/0x230 block/genhd.c:785 __blkdev_get+0x345/0xe50 fs/block_dev.c:1446 blkdev_get+0x97/0x8c0 fs/block_dev.c:1604 blkdev_open+0x1bd/0x240 fs/block_dev.c:1762 do_dentry_open+0x426/0xda0 fs/open.c:764 vfs_open+0x11c/0x210 fs/open.c:878 do_last fs/namei.c:3455 [inline] path_openat+0x5f9/0x2930 fs/namei.c:3597 do_filp_open+0x197/0x270 fs/namei.c:3631 do_sys_open+0x2ef/0x580 fs/open.c:1071 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 4046: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kfree+0xf5/0x310 mm/slub.c:3897 device_release+0xf4/0x1a0 drivers/base/core.c:822 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x146/0x200 lib/kobject.c:692 put_disk+0x1f/0x30 block/genhd.c:1452 __blkdev_get+0x5fa/0xe50 fs/block_dev.c:1541 blkdev_get+0x97/0x8c0 fs/block_dev.c:1604 blkdev_open+0x1bd/0x240 fs/block_dev.c:1762 do_dentry_open+0x426/0xda0 fs/open.c:764 vfs_open+0x11c/0x210 fs/open.c:878 do_last fs/namei.c:3455 [inline] path_openat+0x5f9/0x2930 fs/namei.c:3597 do_filp_open+0x197/0x270 fs/namei.c:3631 do_sys_open+0x2ef/0x580 fs/open.c:1071 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8881d7248880 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8881d7248880, ffff8881d7249080) The buggy address belongs to the page: page:ffffea00075c9200 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 0000000000000000 00000001800f000f raw: dead000000000100 dead000000000200 ffff8881da802800 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d7248c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d7248d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d7248d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d7248e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d7248e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================