binder: 18571:18588 got transaction with invalid offsets ptr binder: 18571:18588 transaction failed 29201/-14, size 112-24 line 3305 ================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1543 Read of size 8 at addr ffff8801d707e2e8 by task syz-executor.1/18599 CPU: 0 PID: 18599 Comm: syz-executor.1 Not tainted 4.4.174+ #17 0000000000000000 9d17b07e77b47886 ffff8800b41676c0 ffffffff81aad1a1 0000000000000000 ffffea00075c1e00 ffff8801d707e2e8 0000000000000008 0000000000000000 ffff8800b41676f8 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 [] C_SYSC_open fs/compat.c:1092 [inline] [] compat_SyS_open+0x2a/0x40 fs/compat.c:1090 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a Allocated by task 18588: [] 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 [] C_SYSC_ioctl fs/compat_ioctl.c:1592 [inline] [] compat_SyS_ioctl+0x403/0x2210 fs/compat_ioctl.c:1544 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a Freed by task 18599: [] 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 [] C_SYSC_open fs/compat.c:1092 [inline] [] compat_SyS_open+0x2a/0x40 fs/compat.c:1090 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a The buggy address belongs to the object at ffff8801d707dd80 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8801d707dd80, ffff8801d707e580) The buggy address belongs to the page: kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 18583 Comm: syz-executor.1 Not tainted 4.4.174+ #17 task: ffff8801bd360000 task.stack: ffff88019e0e8000 RIP: 0010:[] [] __rb_insert lib/rbtree.c:118 [inline] RIP: 0010:[] [] rb_insert_color+0x71/0x9d0 lib/rbtree.c:420 RSP: 0018:ffff8801db707d18 EFLAGS: 00010006 RAX: 0800000000000811 RBX: ffffea00075c1e00 RCX: 1ffffd4000eb83c1 RDX: 1ffff1003b6e3318 RSI: ffff8801db719390 RDI: ffff8801db7198c0 RBP: ffff8801db707d58 R08: ffffffff840ebd88 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000000 R12: 4000000000004080 R13: ffff8801db7198c0 R14: dffffc0000000000 R15: 4000000000004088 FS: 0000000000000000(0000) GS:ffff8801db700000(0063) knlGS:00000000f5538b40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 0000000020ed11ff CR3: 00000001d07ee000 CR4: 00000000001606b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffffffff81b0abec ffffffff82fb8bc0 0000000000000001 ffff8801db719390 ffff8801db7198c0 dffffc0000000000 000000698e5c9c00 ffffea00075c1e08 ffff8801db707d98 ffffffff81ac9ff8 ffff8801db719390 ffff8801db719380 Call Trace: [] timerqueue_add+0x1a8/0x320 lib/timerqueue.c:57 [] enqueue_hrtimer+0x15c/0x450 kernel/time/hrtimer.c:893 [] __run_hrtimer kernel/time/hrtimer.c:1276 [inline] [] __hrtimer_run_queues+0x65a/0xfc0 kernel/time/hrtimer.c:1325 [] hrtimer_interrupt+0x1b6/0x450 kernel/time/hrtimer.c:1359 [] local_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:901 [] smp_apic_timer_interrupt+0x79/0xb0 arch/x86/kernel/apic/apic.c:925 [] apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:768 [] smp_call_function_many+0x5c0/0x730 kernel/smp.c:435 [] native_flush_tlb_others+0x110/0x710 arch/x86/mm/tlb.c:325 [] flush_tlb_others arch/x86/include/asm/paravirt.h:338 [inline] [] flush_tlb_mm_range+0x10e/0x550 arch/x86/mm/tlb.c:391 [] flush_tlb_page arch/x86/include/asm/tlbflush.h:300 [inline] [] ptep_clear_flush+0xe7/0x120 mm/pgtable-generic.c:80 [] wp_page_copy.isra.0+0x6e3/0xc70 mm/memory.c:2202 [] do_wp_page+0x23a/0x1340 mm/memory.c:2441 [] handle_pte_fault mm/memory.c:3362 [inline] [] __handle_mm_fault mm/memory.c:3474 [inline] [] handle_mm_fault+0x1614/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 [] pipe_read+0x274/0x860 fs/pipe.c:270 [] new_sync_read fs/read_write.c:424 [inline] [] __vfs_read+0x2e5/0x3c0 fs/read_write.c:436 [] vfs_read+0x134/0x360 fs/read_write.c:456 [] SYSC_read fs/read_write.c:571 [inline] [] SyS_read+0xdc/0x1c0 fs/read_write.c:564 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a Code: 48 89 d8 48 c1 e8 03 42 80 3c 30 00 0f 85 d0 05 00 00 4c 8b 23 41 f6 c4 01 0f 85 7f 01 00 00 4d 8d 7c 24 08 4c 89 f8 48 c1 e8 03 <42> 80 3c 30 00 0f 85 c1 05 00 00 49 8b 7c 24 08 48 39 df 0f 84 RIP [] __rb_insert lib/rbtree.c:118 [inline] RIP [] rb_insert_color+0x71/0x9d0 lib/rbtree.c:420 RSP ---[ end trace 82d205890ac5c7f2 ]---