================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x2eff/0x3640 kernel/locking/lockdep.c:3224 Read of size 8 at addr ffff8801c8e77738 by task syzkaller699503/3342 CPU: 1 PID: 3342 Comm: syzkaller699503 Not tainted 4.9.77-g033d019 #14 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c94378e0 ffffffff81d941c9 ffffea0007239d80 ffff8801c8e77738 0000000000000000 ffff8801c8e77738 ffff8801c8e77738 ffff8801c9437918 ffffffff8153db93 ffff8801c8e77738 0000000000000008 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x73/0x280 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report+0x275/0x360 mm/kasan/report.c:408 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] __lock_acquire+0x2eff/0x3640 kernel/locking/lockdep.c:3224 [] lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756 [] __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:535 [inline] [] ep_unregister_pollwait.isra.6+0xaf/0x240 fs/eventpoll.c:553 [] ep_free+0x96/0x1b0 fs/eventpoll.c:770 [] ep_eventpoll_release+0x44/0x60 fs/eventpoll.c:802 [] __fput+0x28c/0x6e0 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x115/0x190 kernel/task_work.c:116 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x7e7/0x2a40 kernel/exit.c:833 [] do_group_exit+0x108/0x320 kernel/exit.c:937 [] SYSC_exit_group kernel/exit.c:948 [inline] [] SyS_exit_group+0x1d/0x20 kernel/exit.c:946 [] entry_SYSCALL_64_fastpath+0x29/0xe8 Allocated by task 3342: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:609 kmem_cache_alloc_trace+0xfb/0x2a0 mm/slub.c:2742 kmalloc include/linux/slab.h:490 [inline] kzalloc include/linux/slab.h:636 [inline] binder_get_thread+0x15d/0x750 drivers/android/binder.c:4451 binder_poll+0x4a/0x210 drivers/android/binder.c:4554 ep_item_poll fs/eventpoll.c:811 [inline] ep_insert fs/eventpoll.c:1347 [inline] SYSC_epoll_ctl fs/eventpoll.c:1975 [inline] SyS_epoll_ctl+0x11d7/0x2190 fs/eventpoll.c:1861 entry_SYSCALL_64_fastpath+0x29/0xe8 Freed by task 3342: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0x103/0x300 mm/slub.c:3878 binder_free_thread drivers/android/binder.c:4479 [inline] binder_thread_dec_tmpref+0x1cc/0x240 drivers/android/binder.c:2035 binder_thread_release+0x27d/0x540 drivers/android/binder.c:4543 binder_ioctl+0x9c0/0x11b0 drivers/android/binder.c:4759 vfs_ioctl fs/ioctl.c:43 [inline] do_vfs_ioctl+0x1aa/0x1140 fs/ioctl.c:679 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 entry_SYSCALL_64_fastpath+0x29/0xe8 The buggy address belongs to the object at ffff8801c8e77680 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 184 bytes inside of 512-byte region [ffff8801c8e77680, ffff8801c8e77880) The buggy address belongs to the page: page:ffffea0007239d80 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x8000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c8e77600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c8e77680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c8e77700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c8e77780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c8e77800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================