================================================================== BUG: KASAN: use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock+0x1ac/0x1e0 kernel/locking/spinlock_debug.c:112 Read of size 4 at addr ffff8801da2b6fa4 by task syz-executor2/6309 CPU: 1 PID: 6309 Comm: syz-executor2 Not tainted 4.9.81-g1a93831 #33 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801d49d7c40 ffffffff81d94e69 ffffea000768ad80 ffff8801da2b6fa4 0000000000000000 ffff8801da2b6fa4 ffff8801bc512100 ffff8801d49d7c78 ffffffff8153e1e3 ffff8801da2b6fa4 0000000000000004 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_load4_noabort+0x14/0x20 mm/kasan/report.c:428 [] debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline] [] do_raw_spin_lock+0x1ac/0x1e0 kernel/locking/spinlock_debug.c:112 [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:119 [inline] [] _raw_spin_lock_irqsave+0x56/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 [] tracehook_notify_resume include/linux/tracehook.h:191 [inline] [] exit_to_usermode_loop+0xfc/0x120 arch/x86/entry/common.c:161 [] prepare_exit_to_usermode arch/x86/entry/common.c:191 [inline] [] syscall_return_slowpath arch/x86/entry/common.c:260 [inline] [] do_syscall_64+0x370/0x490 arch/x86/entry/common.c:287 [] entry_SYSCALL_64_after_swapgs+0x47/0xc5 Allocated by task 6298: 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:4566 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 do_syscall_64+0x1a5/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x47/0xc5 Freed by task 6298: 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+0x3a7/0x5c0 drivers/android/binder.c:4555 binder_ioctl+0x9c0/0x11b0 drivers/android/binder.c:4771 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 do_syscall_64+0x1a5/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x47/0xc5 The buggy address belongs to the object at ffff8801da2b6f00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 164 bytes inside of 512-byte region [ffff8801da2b6f00, ffff8801da2b7100) The buggy address belongs to the page: page:ffffea000768ad80 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: ffff8801da2b6e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801da2b6f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801da2b6f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801da2b7000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801da2b7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================