bisecting fixing commit since 4520f06b03ae667e442da1ab9351fd28cd7ac598 building syzkaller on 99a9604483616177d7cd7d3e092ce42a3eaff74a testing commit 4520f06b03ae667e442da1ab9351fd28cd7ac598 with gcc (GCC) 8.1.0 kernel signature: 7b65103d3fbd7bd7bb686063004d07d5ebcdbe77561345042259891467c190f6 all runs: crashed: KASAN: use-after-free Read in remove_wait_queue testing current HEAD ab9dfda232481dcfaf549ce774004d116fc80c13 testing commit ab9dfda232481dcfaf549ce774004d116fc80c13 with gcc (GCC) 8.1.0 kernel signature: 77c5d179d4959204b45c38bd08b57d4c6311009ab2ff9ecd95f3b7cb85f4c388 all runs: crashed: KASAN: use-after-free Read in remove_wait_queue revisions tested: 2, total time: 26m28.340762156s (build: 18m53.869091274s, test: 6m19.00731563s) the crash still happens on HEAD commit msg: Linux 4.14.180 crash: KASAN: use-after-free Read in remove_wait_queue batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_UP): veth1_macvtap: link is not ready ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x32f9/0x4500 kernel/locking/lockdep.c:3369 Read of size 8 at addr ffff888085b97280 by task syz-executor.2/7775 CPU: 0 PID: 7775 Comm: syz-executor.2 Not tainted 4.14.180-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __lock_acquire+0x32f9/0x4500 kernel/locking/lockdep.c:3369 lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3998 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:160 remove_wait_queue+0x20/0x1b0 kernel/sched/wait.c:50 ep_remove_wait_queue fs/eventpoll.c:611 [inline] ep_unregister_pollwait.isra.10+0x81/0x310 fs/eventpoll.c:629 ep_remove+0x46/0x440 fs/eventpoll.c:792 eventpoll_release_file+0xb7/0x130 fs/eventpoll.c:1020 eventpoll_release include/linux/eventpoll.h:66 [inline] __fput+0x4df/0x750 fs/file_table.c:201 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x16a/0x1b0 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45c879 RSP: 002b:00007f423d59ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: 0000000000000000 RBX: 00007f423d59b6d4 RCX: 000000000045c879 RDX: 0000000000000000 RSI: 000000004004743c RDI: 0000000000000003 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000002cd R14: 00000000004c5210 R15: 000000000076bf0c Allocated by task 7775: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3689 kmalloc_node include/linux/slab.h:530 [inline] kvmalloc_node+0x70/0x80 mm/util.c:397 kvmalloc include/linux/mm.h:531 [inline] kvzalloc include/linux/mm.h:539 [inline] alloc_netdev_mqs+0x60/0xb40 net/core/dev.c:8098 ppp_create_interface drivers/net/ppp/ppp_generic.c:3019 [inline] ppp_unattached_ioctl drivers/net/ppp/ppp_generic.c:864 [inline] ppp_ioctl+0x1412/0x24d3 drivers/net/ppp/ppp_generic.c:600 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x180/0xfb0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x74/0x80 fs/ioctl.c:692 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 7775: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 kvfree+0x2c/0x30 mm/util.c:416 netdev_freemem+0x47/0x60 net/core/dev.c:8050 netdev_release+0x6a/0x80 net/core/net-sysfs.c:1506 device_release+0x134/0x170 drivers/base/core.c:833 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x10d/0x1b0 lib/kobject.c:692 put_device+0x12/0x20 drivers/base/core.c:2014 free_netdev+0x237/0x320 net/core/dev.c:8220 ppp_destroy_interface+0x280/0x350 drivers/net/ppp/ppp_generic.c:3101 ppp_release+0x102/0x190 drivers/net/ppp/ppp_generic.c:414 ppp_ioctl+0x401/0x24d3 drivers/net/ppp/ppp_generic.c:626 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x180/0xfb0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x74/0x80 fs/ioctl.c:692 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff888085b96700 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2944 bytes inside of 4096-byte region [ffff888085b96700, ffff888085b97700) The buggy address belongs to the page: page:ffffea000216e580 count:1 mapcount:0 mapping:ffff888085b96700 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff888085b96700 0000000000000000 0000000100000001 raw: ffffea0002953da0 ffffea0002a20aa0 ffff8880aa800dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888085b97180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888085b97200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888085b97280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888085b97300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888085b97380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================