binder: BINDER_SET_CONTEXT_MGR already set binder: 24647:24659 ioctl 40046207 0 returned -16 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x387e/0x4b50 kernel/locking/lockdep.c:3092 Read of size 8 at addr ffff8801d097d9b8 by task syz-executor1/24674 CPU: 1 PID: 24674 Comm: syz-executor1 Not tainted 4.4.112-g5f6325b #21 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 6bfcfef3e79756f0 ffff8801cc887530 ffffffff81d0579d ffffea0007425f00 ffff8801d097d9b8 0000000000000000 ffff8801d097d9b8 0000000000000000 ffff8801cc887568 ffffffff814fd9f3 ffff8801d097d9b8 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_address_description+0x73/0x260 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report+0x285/0x370 mm/kasan/report.c:408 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] __lock_acquire+0x387e/0x4b50 kernel/locking/lockdep.c:3092 [] lock_acquire+0x15e/0x460 kernel/locking/lockdep.c:3592 [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:112 [inline] [] _raw_spin_lock_irqsave+0x4e/0x70 kernel/locking/spinlock.c:159 [] remove_wait_queue+0x14/0x40 kernel/sched/wait.c:49 [] ep_remove_wait_queue fs/eventpoll.c:530 [inline] [] ep_unregister_pollwait.isra.6+0xa8/0x220 fs/eventpoll.c:548 [] ep_free+0x93/0x1c0 fs/eventpoll.c:765 [] ep_eventpoll_release+0x44/0x60 fs/eventpoll.c:797 [] __fput+0x233/0x6d0 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x104/0x180 kernel/task_work.c:115 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x871/0x2a20 kernel/exit.c:755 [] do_group_exit+0x108/0x320 kernel/exit.c:885 [] get_signal+0x565/0x1660 kernel/signal.c:2317 [] do_signal+0x8b/0x1d40 arch/x86/kernel/signal.c:712 [] exit_to_usermode_loop+0x122/0x170 arch/x86/entry/common.c:247 [] prepare_exit_to_usermode arch/x86/entry/common.c:282 [inline] [] syscall_return_slowpath arch/x86/entry/common.c:347 [inline] [] do_syscall_32_irqs_on arch/x86/entry/common.c:396 [inline] [] do_fast_syscall_32+0x607/0x890 arch/x86/entry/common.c:457 [] sysenter_flags_fixed+0xd/0x17 Allocated by task 24651: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:616 [] kmem_cache_alloc_trace+0x100/0x2b0 mm/slub.c:2642 [] kmalloc include/linux/slab.h:476 [inline] [] kzalloc include/linux/slab.h:620 [inline] [] binder_get_thread+0x181/0x7a0 drivers/android/binder.c:4452 [] binder_poll+0x4a/0x210 drivers/android/binder.c:4555 [] ep_item_poll fs/eventpoll.c:806 [inline] [] ep_insert fs/eventpoll.c:1319 [inline] [] SYSC_epoll_ctl fs/eventpoll.c:1934 [inline] [] SyS_epoll_ctl+0x10b1/0x2050 fs/eventpoll.c:1833 [] do_syscall_32_irqs_on arch/x86/entry/common.c:390 [inline] [] do_fast_syscall_32+0x314/0x890 arch/x86/entry/common.c:457 [] sysenter_flags_fixed+0xd/0x17 Freed by task 24651: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_slab_free+0x72/0xc0 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+0xfc/0x300 mm/slub.c:3749 [] binder_free_thread drivers/android/binder.c:4480 [inline] [] binder_thread_dec_tmpref+0x1c1/0x250 drivers/android/binder.c:2036 [] binder_thread_release+0x27d/0x540 drivers/android/binder.c:4544 [] binder_ioctl+0xb94/0x12e0 drivers/android/binder.c:4760 [] C_SYSC_ioctl fs/compat_ioctl.c:1592 [inline] [] compat_SyS_ioctl+0x28a/0x2540 fs/compat_ioctl.c:1544 [] do_syscall_32_irqs_on arch/x86/entry/common.c:390 [inline] [] do_fast_syscall_32+0x314/0x890 arch/x86/entry/common.c:457 [] sysenter_flags_fixed+0xd/0x17 The buggy address belongs to the object at ffff8801d097d900 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 184 bytes inside of 512-byte region [ffff8801d097d900, ffff8801d097db00) 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 Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 5110 Comm: syz-executor6 Not tainted 4.4.112-g5f6325b #21 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801ce98af80 task.stack: ffff8801cf3b8000 RIP: 0010:[] [] __rb_insert lib/rbtree.c:120 [inline] RIP: 0010:[] [] rb_insert_color+0x9f/0xcb0 lib/rbtree.c:420 RSP: 0018:ffff8801cf3bfa40 EFLAGS: 00010003 RAX: 0a0508a8e82a0be9 RBX: ffffffff838a8620 RCX: ffffffff838a8620 RDX: 1ffffffff07150c5 RSI: ffff8801db219710 RDI: ffff8801cf3bfd28 RBP: ffff8801cf3bfa88 R08: ffffffff857d4c88 R09: 0000000000000001 R10: 0000000000000000 R11: 1ffff10039e77f08 R12: ffff8801c7d0fdf8 R13: 5028454741505f4e R14: ffff8801cf3bfd28 R15: dffffc0000000000 FS: 0000000000000000(0000) GS:ffff8801db200000(0063) knlGS:0000000009581900 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000091df6b4 CR3: 00000001ccb4e000 CR4: 0000000000160670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffffffff842bcb20 ffff8801ce98b7f0 0000000000000000 ffff8801cf3bfa98 ffff8801cf3bfd28 dffffc0000000000 0000000000000000 ffff8801db219710 ffff8801c7d0fe00 ffff8801cf3bfad8 ffffffff81d23067 ffff8801cf3bfd40 Call Trace: [] timerqueue_add+0x157/0x2a0 lib/timerqueue.c:57 [] enqueue_hrtimer+0x168/0x450 kernel/time/hrtimer.c:890 [] hrtimer_start_range_ns+0x560/0x1440 kernel/time/hrtimer.c:1010 [] hrtimer_start_expires include/linux/hrtimer.h:407 [inline] [] do_nanosleep+0x19c/0x4f0 kernel/time/hrtimer.c:1492 [] hrtimer_nanosleep+0x21e/0x530 kernel/time/hrtimer.c:1564 [] C_SYSC_nanosleep kernel/compat.c:254 [inline] [] compat_SyS_nanosleep+0x279/0x390 kernel/compat.c:239 [] do_syscall_32_irqs_on arch/x86/entry/common.c:390 [inline] [] do_fast_syscall_32+0x314/0x890 arch/x86/entry/common.c:457 [] sysenter_flags_fixed+0xd/0x17 Code: 48 89 c2 48 c1 ea 03 42 80 3c 3a 00 0f 85 94 09 00 00 4c 8b 6b 08 4d 39 e5 0f 84 b0 01 00 00 4d 85 ed 74 1d 4c 89 e8 48 c1 e8 03 <42> 80 3c 38 00 0f 85 95 09 00 00 41 f6 45 00 01 0f 84 20 03 00 RIP [] __rb_insert lib/rbtree.c:120 [inline] RIP [] rb_insert_color+0x9f/0xcb0 lib/rbtree.c:420 RSP ---[ end trace 5ab3ab0584d16e89 ]---