================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1543 Read of size 8 at addr ffff8801cf3a8568 by task syz-executor573/2089 CPU: 0 PID: 2089 Comm: syz-executor573 Not tainted 4.4.174+ #4 0000000000000000 296d3e421fc83d37 ffff8800b658f730 ffffffff81aad1a1 0000000000000000 ffffea00073cea00 ffff8801cf3a8568 0000000000000008 0000000000000000 ffff8800b658f768 ffffffff81490120 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [] print_address_description+0x6f/0x21b mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report mm/kasan/report.c:408 [inline] [] kasan_report.cold+0x8c/0x2be mm/kasan/report.c:393 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] disk_unblock_events+0x55/0x60 block/genhd.c:1543 [] __blkdev_get+0x70c/0xdf0 fs/block_dev.c:1297 [] blkdev_get+0x2e8/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1aa/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38f/0xbd0 fs/open.c:749 [] vfs_open+0x10b/0x210 fs/open.c:862 [] do_last fs/namei.c:3269 [inline] [] path_openat+0x136f/0x4470 fs/namei.c:3406 [] do_filp_open+0x1a1/0x270 fs/namei.c:3440 [] do_sys_open+0x2f8/0x600 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 2089: [] 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.0+0x62/0xf0 mm/kasan/kasan.c:616 [] kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:601 [] kmem_cache_alloc_trace+0x123/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+0x50/0x3c0 block/genhd.c:1282 [] alloc_disk+0x1b/0x20 block/genhd.c:1274 [] loop_add+0x380/0x830 drivers/block/loop.c:1857 [] loop_control_ioctl+0x138/0x2f0 drivers/block/loop.c:1988 [] vfs_ioctl fs/ioctl.c:43 [inline] [] file_ioctl fs/ioctl.c:470 [inline] [] do_vfs_ioctl+0x6e7/0xfa0 fs/ioctl.c:605 [] SYSC_ioctl fs/ioctl.c:622 [inline] [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:613 [] entry_SYSCALL_64_fastpath+0x1e/0x9a Freed by task 2089: [] 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+0xb0/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+0x255/0x330 block/genhd.c:1118 [] device_release+0x7d/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+0x14c/0x260 lib/kobject.c:689 [] put_disk+0x23/0x30 block/genhd.c:1346 [] __blkdev_get+0x66c/0xdf0 fs/block_dev.c:1290 [] blkdev_get+0x2e8/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1aa/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38f/0xbd0 fs/open.c:749 [] vfs_open+0x10b/0x210 fs/open.c:862 [] do_last fs/namei.c:3269 [inline] [] path_openat+0x136f/0x4470 fs/namei.c:3406 [] do_filp_open+0x1a1/0x270 fs/namei.c:3440 [] do_sys_open+0x2f8/0x600 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 ffff8801cf3a8000 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8801cf3a8000, ffff8801cf3a8800) The buggy address belongs to the page: BUG: unable to handle kernel paging request at ffffeb88001cf3a0 IP: [] __read_once_size include/linux/compiler.h:218 [inline] IP: [] compound_head include/linux/page-flags.h:415 [inline] IP: [] virt_to_head_page include/linux/mm.h:523 [inline] IP: [] qlink_to_cache mm/kasan/quarantine.c:127 [inline] IP: [] qlist_free_all+0x7a/0xc0 mm/kasan/quarantine.c:163 PGD 0 Oops: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 2076 Comm: syz-executor573 Not tainted 4.4.174+ #4 task: ffff8801d4ed97c0 task.stack: ffff8800b6af0000 RIP: 0010:[] [] __read_once_size include/linux/compiler.h:218 [inline] RIP: 0010:[] [] compound_head include/linux/page-flags.h:415 [inline] RIP: 0010:[] [] virt_to_head_page include/linux/mm.h:523 [inline] RIP: 0010:[] [] qlink_to_cache mm/kasan/quarantine.c:127 [inline] RIP: 0010:[] [] qlist_free_all+0x7a/0xc0 mm/kasan/quarantine.c:163 RSP: 0000:ffff8800b6af7860 EFLAGS: 00010282 RAX: ffffeb88001cf380 RBX: 0000000000000000 RCX: 000000018080005f RDX: 000077ff80000000 RSI: ffffea00073cea00 RDI: 0000000000000000 RBP: ffff8800b6af7888 R08: 0000000000000001 R09: ffffffff814850f1 R10: ffffea0002d944c0 R11: 0000000000000000 R12: ffff8800b6af78a0 R13: 0000000080000000 R14: ffffea0000000000 R15: ffffea00073cea00 FS: 00000000024d0880(0063) GS:ffff8801db700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffeb88001cf3a0 CR3: 00000000b68a6000 CR4: 00000000001606b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff8801d4ed97c0 0000000000000000 ffff8800b6af78a0 ffffffff81139e98 ffff8801da488640 ffff8800b6af78d0 ffffffff8148558f ffffffff81485495 ffff8801d3e58000 ffff8800b641c400 00000000001010a0 7d276a79957381f4 Call Trace: [] quarantine_reduce+0x18f/0x1d0 mm/kasan/quarantine.c:259 [] kasan_kmalloc+0xa0/0xd0 mm/kasan/kasan.c:601 [] kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:554 [] slab_post_alloc_hook mm/slub.c:1349 [inline] [] slab_alloc_node mm/slub.c:2615 [inline] [] slab_alloc mm/slub.c:2623 [inline] [] kmem_cache_alloc+0xdc/0x2c0 mm/slub.c:2628 [] prepare_creds+0x28/0x2b0 kernel/cred.c:251 [] do_coredump+0x30f/0x29d0 fs/coredump.c:547 [] get_signal+0x5d9/0x1570 kernel/signal.c:2315 [] do_signal+0x9c/0x1840 arch/x86/kernel/signal.c:712 [] exit_to_usermode_loop+0x127/0x170 arch/x86/entry/common.c:184 [] prepare_exit_to_usermode+0x15a/0x1e0 arch/x86/entry/common.c:221 [] retint_user+0x8/0x3c Code: 4c 89 fe 48 85 db 48 89 df 75 d7 48 89 f0 4c 01 e8 72 52 48 ba 00 00 00 80 ff 77 00 00 48 01 d0 48 c1 e8 0c 48 c1 e0 06 4c 01 f0 <48> 8b 50 20 48 8d 4a ff 83 e2 01 48 0f 45 c1 48 8b 78 30 eb a2 RIP [] virt_to_head_page include/linux/mm.h:521 [inline] RIP [] qlink_to_cache mm/kasan/quarantine.c:127 [inline] RIP [] qlist_free_all+0x7a/0xc0 mm/kasan/quarantine.c:163 RSP CR2: ffffeb88001cf3a0 ---[ end trace dbaf3d1cc2c5a2c7 ]---