================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1543 Read of size 8 at addr ffff8800bb48f3e8 by task blkid/2682 CPU: 0 PID: 2682 Comm: blkid Not tainted 4.4.172+ #13 0000000000000000 332adde1b6e14b29 ffff8800bb4cf730 ffffffff81aacde1 0000000000000000 ffffea0002ed2200 ffff8800bb48f3e8 0000000000000008 0000000000000000 ffff8800bb4cf768 ffffffff8148fedd 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 2674: [] 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:1854 [] loop_control_ioctl drivers/block/loop.c:1989 [inline] [] loop_control_ioctl+0x132/0x2f0 drivers/block/loop.c:1971 [] 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 2682: [] 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 ffff8800bb48ee80 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8800bb48ee80, ffff8800bb48f680) The buggy address belongs to the page: BUG: unable to handle kernel paging request at fffffbfffc053b4b IP: [] rcu_sync_lockdep_assert+0x5d/0xb0 kernel/rcu/sync.c:68 PGD 21ff68067 PUD 21ff67067 PMD 0 Oops: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 2955 Comm: syz-executor553 Not tainted 4.4.172+ #13 task: ffff8801cea90000 task.stack: ffff8801cea98000 RIP: 0010:[] [] rcu_sync_lockdep_assert+0x5d/0xb0 kernel/rcu/sync.c:68 RSP: 0018:ffff8801cea9fc20 EFLAGS: 00010a06 RAX: dffffc0000000000 RBX: 0000000002ed2200 RCX: 1ffffffff05f7178 RDX: 1ffffffffc053b4b RSI: ffffffff81b0a7fc RDI: ffffffffe029da58 RBP: ffff8801cea9fc28 R08: ffff8801d4dd59a0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000148 R13: ffff8800bb496600 R14: ffff8800bb4969b8 R15: 0000000000000000 FS: 0000000002599880(0063) GS:ffff8801db700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: fffffbfffc053b4b CR3: 00000001d9153000 CR4: 00000000001606b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff8800bb4969b8 ffff8801cea9fc68 ffffffff8149e59f 0000001d811ea67b ffff8801d6dcb720 ffff8801d40ce620 ffff8801d40ce670 ffff8801d42d5888 0000000000000001 ffff8801cea9fd00 ffffffff814b0bf4 ffff8801cea90008 Call Trace: [] rcu_sync_is_idle include/linux/rcu_sync.h:56 [inline] [] percpu_down_read_trylock include/linux/percpu-rwsem.h:56 [inline] [] __sb_start_write+0xdf/0x310 fs/super.c:1223 [] sb_start_write_trylock include/linux/fs.h:1522 [inline] [] pipe_write+0x8f4/0xe70 fs/pipe.c:472 [] new_sync_write fs/read_write.c:478 [inline] [] __vfs_write+0x2e8/0x3d0 fs/read_write.c:491 [] vfs_write+0x182/0x4e0 fs/read_write.c:538 [] SYSC_write fs/read_write.c:585 [inline] [] SyS_write+0xdc/0x1c0 fs/read_write.c:577 [] entry_SYSCALL_64_fastpath+0x1e/0x9a Code: 02 84 c0 74 04 3c 03 7e 60 48 b8 00 00 00 00 00 fc ff df 8b 5b 68 48 89 df 48 c1 e7 05 48 81 c7 58 9a 85 82 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 3f 48 c1 e3 05 48 8b 83 58 9a 85 82 e8 3d 2a 4e RIP [] rcu_sync_lockdep_assert+0x5d/0xb0 kernel/rcu/sync.c:68 RSP CR2: fffffbfffc053b4b ---[ end trace a9f5402e5043da3b ]---