binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 27, target dead ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x387e/0x4b50 kernel/locking/lockdep.c:3092 Read of size 8 at addr ffff8801d16e5238 by task syz-executor0/8738 CPU: 0 PID: 8738 Comm: syz-executor0 Not tainted 4.4.111-g1849cd3 #26 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 bde971c5aba81b03 ffff8801ce8cf580 ffffffff81d0509d ffffea000745b900 ffff8801d16e5238 0000000000000000 ffff8801d16e5238 0000000000000000 ffff8801ce8cf5b8 ffffffff814fd433 ffff8801d16e5238 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+0x1b5/0x1f0 arch/x86/entry/common.c:347 [] int_ret_from_sys_call+0x25/0xa3 Allocated by task 8731: [] 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 [] entry_SYSCALL_64_fastpath+0x16/0x92 Freed by task 8731: [] 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 [] vfs_ioctl fs/ioctl.c:43 [inline] [] do_vfs_ioctl+0x7aa/0xee0 fs/ioctl.c:607 [] SYSC_ioctl fs/ioctl.c:622 [inline] [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:613 [] entry_SYSCALL_64_fastpath+0x16/0x92 The buggy address belongs to the object at ffff8801d16e5180 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 184 bytes inside of 512-byte region [ffff8801d16e5180, ffff8801d16e5380) 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: 1 PID: 8696 Comm: syz-executor6 Not tainted 4.4.111-g1849cd3 #26 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8800b2db5f00 task.stack: ffff8800b6968000 RIP: 0010:[] [] lookup_object lib/debugobjects.c:120 [inline] RIP: 0010:[] [] debug_object_deactivate+0x1a6/0x3c0 lib/debugobjects.c:465 RSP: 0018:ffff8801db307d20 EFLAGS: 00010006 RAX: 0000000000000092 RBX: 000000000071bf80 RCX: ffff8800b7b0fdf8 RDX: 00000000000e37f3 RSI: ffffffff842c5420 RDI: 000000000071bf98 RBP: ffff8801db307de8 R08: 1ffff10039b9a6ff R09: ffffffff850fc300 R10: 0000000000000001 R11: 1ffff1003b660f6a R12: 1ffff1003b660fa8 R13: 000000000002ff0c R14: dffffc0000000000 R15: ffffffff857b04c8 FS: 00007ff5cad9e700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020e59000 CR3: 00000001cee66000 CR4: 0000000000160670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: 0000000000000093 ffffffff842c5420 ffff8800b7b0fdf8 0000000000000092 0000000041b58ab3 ffffffff83fcc949 ffffffff81d66eb0 ffff8800b2db5f00 ffffed00165b6ced ffff8801db319658 ffff8800b2db6770 0000000000000001 Call Trace: [] debug_hrtimer_deactivate kernel/time/hrtimer.c:415 [inline] [] debug_deactivate kernel/time/hrtimer.c:461 [inline] [] __run_hrtimer kernel/time/hrtimer.c:1222 [inline] [] __hrtimer_run_queues+0x492/0xfe0 kernel/time/hrtimer.c:1317 [] hrtimer_interrupt+0x1a6/0x440 kernel/time/hrtimer.c:1351 [] local_apic_timer_interrupt+0x6a/0xb0 arch/x86/kernel/apic/apic.c:901 [] smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:925 [] apic_timer_interrupt+0xa0/0xb0 arch/x86/entry/entry_64.S:725 [] smp_call_function_many+0x481/0x710 kernel/smp.c:435 [] smp_call_function+0x5d/0xa0 kernel/smp.c:491 [] on_each_cpu+0x2f/0xc0 kernel/smp.c:597 [] rollback_registered_many+0x2ef/0x7c0 net/core/dev.c:6311 [] rollback_registered+0x81/0xb0 net/core/dev.c:6367 [] unregister_netdevice_queue+0x81/0x140 net/core/dev.c:7317 [] unregister_netdevice include/linux/netdevice.h:2282 [inline] [] __tun_detach+0x7b7/0xa50 drivers/net/tun.c:548 [] tun_detach drivers/net/tun.c:557 [inline] [] tun_chr_close+0x44/0x60 drivers/net/tun.c:2261 [] __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+0x1b5/0x1f0 arch/x86/entry/common.c:347 [] int_ret_from_sys_call+0x25/0xa3 Code: eb 1a 48 89 da 48 c1 ea 03 42 80 3c 32 00 0f 85 86 01 00 00 48 8b 1b 48 85 db 74 7a 48 8d 7b 18 41 83 c5 01 48 89 fa 48 c1 ea 03 <42> 80 3c 32 00 0f 85 3c 01 00 00 48 3b 4b 18 75 c6 48 8d 7b 10 RIP [] lookup_object lib/debugobjects.c:120 [inline] RIP [] debug_object_deactivate+0x1a6/0x3c0 lib/debugobjects.c:465 RSP ---[ end trace ba8573ed1df94251 ]---