binder: 4887:4889 transaction failed 29189/-22, size 72-24 line 3014 binder: undelivered TRANSACTION_ERROR: 29189 ================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1543 Read of size 8 at addr ffff8800b9f4da68 by task syz-executor.0/2123 CPU: 0 PID: 2123 Comm: syz-executor.0 Not tainted 4.4.174+ #4 0000000000000000 4bed670844cebe9f ffff8800a848f730 ffffffff81aad1a1 0000000000000000 ffffea0002e7d200 ffff8800b9f4da68 0000000000000008 0000000000000000 ffff8800a848f768 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 2123: [] 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_probe+0x154/0x180 drivers/block/loop.c:1963 [] kobj_lookup+0x221/0x410 drivers/base/map.c:124 [] get_gendisk+0x3c/0x2e0 block/genhd.c:689 [] __blkdev_get+0x39c/0xdf0 fs/block_dev.c:1193 [] 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 Freed by task 2123: [] 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 ffff8800b9f4d500 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8800b9f4d500, ffff8800b9f4dd00) The buggy address belongs to the page: BUG: unable to handle kernel paging request at ffffea000fd7aa40 IP: [] constant_test_bit arch/x86/include/asm/bitops.h:311 [inline] IP: [] PageLocked include/linux/page-flags.h:209 [inline] IP: [] migration_entry_to_page include/linux/swapops.h:129 [inline] IP: [] __migration_entry_wait+0xea/0x1e0 mm/migrate.c:221 PGD 21f7fa067 PUD 21f7f9067 PMD 0 Oops: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 2124 Comm: syz-executor.5 Not tainted 4.4.174+ #4 task: ffff8800bbbe2f80 task.stack: ffff8801c3730000 RIP: 0010:[] [] constant_test_bit arch/x86/include/asm/bitops.h:311 [inline] RIP: 0010:[] [] PageLocked include/linux/page-flags.h:209 [inline] RIP: 0010:[] [] migration_entry_to_page include/linux/swapops.h:129 [inline] RIP: 0010:[] [] __migration_entry_wait+0xea/0x1e0 mm/migrate.c:221 RSP: 0000:ffff8801c3737ce8 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: 000000000000001f RCX: 0000000000001e1c RDX: 1ffffd4001faf548 RSI: ffffffff81489181 RDI: ffffffff8142ac50 RBP: ffff8801c3737d08 R08: 0000000000000001 R09: ffff8800bbbe3890 R10: ffffffff83a2c5d0 R11: 0000000000000000 R12: ffff8800b48193c8 R13: ffffea000fd7aa40 R14: ffff8801d8b1da40 R15: ffff8800b48193c8 FS: 0000000002833940(0063) GS:ffff8801db700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffea000fd7aa40 CR3: 00000001c3724000 CR4: 00000000001606b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: 00000000a7c1d000 ffff8800000002b8 00003ffffffff000 ffff8801d8b1da40 ffff8801c3737d40 ffffffff814893e1 ffff8801c3737e98 ffff8800a7c1d2b8 ffffc00000000c50 ffffffff8142ac50 0000000000000000 ffff8801c3737ec0 Call Trace: [] migration_entry_wait+0x131/0x160 mm/migrate.c:245 [] do_swap_page mm/memory.c:2552 [inline] [] handle_pte_fault mm/memory.c:3349 [inline] [] __handle_mm_fault mm/memory.c:3474 [inline] [] handle_mm_fault+0x28b8/0x3140 mm/memory.c:3503 [] __do_page_fault+0x28e/0x7f0 arch/x86/mm/fault.c:1243 [] do_page_fault+0x28/0x30 arch/x86/mm/fault.c:1306 [] page_fault+0x25/0x30 arch/x86/entry/entry_64.S:1064 Code: 00 00 00 ea ff ff 49 21 d5 49 c1 e5 06 49 01 c5 48 b8 00 00 00 00 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 db 00 00 00 <49> 8b 45 00 a8 01 0f 84 a9 00 00 00 e8 25 04 e8 ff 49 8d 5d 1c RIP [] constant_test_bit arch/x86/include/asm/bitops.h:311 [inline] RIP [] PageLocked include/linux/page-flags.h:209 [inline] RIP [] migration_entry_to_page include/linux/swapops.h:129 [inline] RIP [] __migration_entry_wait+0xea/0x1e0 mm/migrate.c:221 RSP CR2: ffffea000fd7aa40 ---[ end trace 02d36a80d7331cfc ]---