binder: BINDER_SET_CONTEXT_MGR already set binder: 6282:6284 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 ffff8801ce7a5738 by task syz-executor2/6284 CPU: 0 PID: 6284 Comm: syz-executor2 Not tainted 4.4.113-g202e079 #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 4c8cdf6bc0146803 ffff8801c532f630 ffffffff81d0278d ffffea000739e900 ffff8801ce7a5738 0000000000000000 ffff8801ce7a5738 0000000000000000 ffff8801c532f668 ffffffff814fd053 ffff8801ce7a5738 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_remove+0x41/0x290 fs/eventpoll.c:711 [] eventpoll_release_file+0xc5/0x140 fs/eventpoll.c:935 [] eventpoll_release include/linux/eventpoll.h:61 [inline] [] __fput+0x521/0x6d0 fs/file_table.c:199 [] ____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+0x82a/0x2a10 kernel/exit.c:755 [] do_group_exit+0x108/0x320 kernel/exit.c:885 [] get_signal+0x4f2/0x1550 kernel/signal.c:2317 [] do_signal+0x8b/0x1d40 arch/x86/kernel/signal.c:712 [] exit_to_usermode_loop+0x11a/0x160 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 6290: [] 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+0x15d/0x750 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/0x2040 fs/eventpoll.c:1833 [] entry_SYSCALL_64_fastpath+0x1c/0x98 Freed by task 6290: [] 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+0x1c/0x98 The buggy address belongs to the object at ffff8801ce7a5680 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 184 bytes inside of 512-byte region [ffff8801ce7a5680, ffff8801ce7a5880) The buggy address belongs to the page: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [< (null)>] (null) PGD 0 Oops: 0010 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.113-g202e079 #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801da3a97c0 task.stack: ffff8801da3b8000 RIP: 0010:[<0000000000000000>] [< (null)>] (null) RSP: 0018:ffff8801db307d18 EFLAGS: 00010206 RAX: 0000000000000000 RBX: ffff8801db307d68 RCX: ffffffff8129fd3b RDX: 0000000000000100 RSI: ffffffff842bdb20 RDI: ffff8801c5320c90 RBP: ffff8801db307df0 R08: 0000000000000001 R09: ffffffff850f5560 R10: 0000000000000000 R11: 1ffff1003b660f70 R12: 1ffff1003b660fa9 R13: ffff8801c5320c30 R14: 0000000000000101 R15: ffffffff83844340 FS: 0000000000000000(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000000420c000 CR4: 0000000000160670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffffffff8129fd4b ffffffff8129fc9c 0000000000000000 ffffffff842c3560 ffff8801c5320c90 0000000000000000 0000000041b58ab3 ffffffff83faa139 ffffffff8129fbc0 ffff8801da3aa030 ffff8801db307d68 ffffffff851dbb70 Call Trace: [] __run_timers kernel/time/timer.c:1254 [inline] [] run_timer_softirq+0x604/0xbb0 kernel/time/timer.c:1437 [] __do_softirq+0x227/0xa38 kernel/softirq.c:273 [] invoke_softirq kernel/softirq.c:350 [inline] [] irq_exit+0x119/0x140 kernel/softirq.c:391 [] exiting_irq arch/x86/include/asm/apic.h:653 [inline] [] smp_apic_timer_interrupt+0x7b/0xa0 arch/x86/kernel/apic/apic.c:926 [] apic_timer_interrupt+0xa0/0xb0 arch/x86/entry/entry_64.S:737 [] arch_safe_halt arch/x86/include/asm/paravirt.h:117 [inline] [] default_idle+0x55/0x3c0 arch/x86/kernel/process.c:291 [] arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:282 [] default_idle_call+0x48/0x70 kernel/sched/idle.c:93 [] cpuidle_idle_call kernel/sched/idle.c:157 [inline] [] cpu_idle_loop kernel/sched/idle.c:253 [inline] [] cpu_startup_entry+0x5fd/0x8f0 kernel/sched/idle.c:301 [] start_secondary+0x304/0x3e0 arch/x86/kernel/smpboot.c:242 Code: Bad RIP value. RIP [< (null)>] (null) RSP CR2: 0000000000000000 ---[ end trace 28121a7eb5fe1fdb ]---