bisecting fixing commit since 3eb2ce825ea1ad89d20f7a3b5780df850e4be274 building syzkaller on e033c1f167809d025521a34e0f97bbc207b880f8 testing commit 3eb2ce825ea1ad89d20f7a3b5780df850e4be274 with gcc (GCC) 8.1.0 run #0: crashed: KASAN: use-after-free Read in rdma_listen run #1: crashed: KASAN: use-after-free Read in cma_cancel_operation run #2: crashed: KASAN: use-after-free Read in cma_cancel_operation run #3: crashed: KASAN: use-after-free Read in cma_cancel_operation run #4: crashed: KASAN: use-after-free Read in cma_cancel_operation run #5: crashed: KASAN: use-after-free Read in cma_cancel_operation run #6: crashed: KASAN: use-after-free Read in cma_cancel_operation run #7: crashed: KASAN: use-after-free Read in cma_cancel_operation run #8: crashed: KASAN: use-after-free Read in cma_cancel_operation run #9: crashed: KASAN: use-after-free Read in cma_cancel_operation testing current HEAD 5c6207539aea8b22490f9569db5aa72ddfd0d486 testing commit 5c6207539aea8b22490f9569db5aa72ddfd0d486 with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in cma_cancel_operation revisions tested: 2, total time: 16m32.541722957s (build: 8m47.541639713s, test: 6m29.78573021s) the crash still happens on HEAD crash: KASAN: use-after-free Read in cma_cancel_operation IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 ================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xe7/0xf3 lib/list_debug.c:54 Read of size 8 at addr ffff8881c6420628 by task syz-executor/4225 CPU: 0 PID: 4225 Comm: syz-executor Not tainted 5.3.0-rc2+ #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x115/0x167 lib/dump_stack.c:113 print_address_description+0x6f/0x2fe mm/kasan/report.c:351 __kasan_report.cold.7+0x1b/0x3f mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:612 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 __list_del_entry_valid+0xe7/0xf3 lib/list_debug.c:54 __list_del_entry include/linux/list.h:131 [inline] list_del include/linux/list.h:139 [inline] cma_cancel_listens drivers/infiniband/core/cma.c:1750 [inline] cma_cancel_operation+0x2f7/0x9c0 drivers/infiniband/core/cma.c:1778 rdma_destroy_id+0x8d/0x9c0 drivers/infiniband/core/cma.c:1842 ucma_close+0x101/0x2d0 drivers/infiniband/core/ucma.c:1762 __fput+0x25a/0x780 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x10e/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x79f/0x2d40 kernel/exit.c:879 do_group_exit+0xf4/0x2e0 kernel/exit.c:983 get_signal+0x368/0x1d10 kernel/signal.c:2729 do_signal+0x87/0x16c0 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x114/0x210 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x468/0x550 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4549c9 Code: e8 6c b8 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 0b ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1746392ce8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000072bf80 RCX: 00000000004549c9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000072bf80 RBP: 000000000072bf80 R08: 0000000000000000 R09: 000000000072bf58 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe2090f80f R14: 00007f17463939c0 R15: 0000000000000001 Allocated by task 4210: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.7+0xc1/0xd0 mm/kasan/common.c:487 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:501 kmem_cache_alloc_trace+0x15b/0x760 mm/slab.c:3550 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:748 [inline] __rdma_create_id+0x5c/0x4d0 drivers/infiniband/core/cma.c:882 ucma_create_id+0x199/0x550 drivers/infiniband/core/ucma.c:501 ucma_write+0x206/0x2e0 drivers/infiniband/core/ucma.c:1684 __vfs_write+0x61/0x110 fs/read_write.c:494 vfs_write+0x191/0x4c0 fs/read_write.c:558 ksys_write+0x197/0x220 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x6e/0xb0 fs/read_write.c:620 do_syscall_64+0xd6/0x550 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 4210: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kfree+0xfa/0x290 mm/slab.c:3756 rdma_destroy_id+0x5f3/0x9c0 drivers/infiniband/core/cma.c:1877 ucma_close+0x101/0x2d0 drivers/infiniband/core/ucma.c:1762 __fput+0x25a/0x780 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x10e/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x79f/0x2d40 kernel/exit.c:879 do_group_exit+0xf4/0x2e0 kernel/exit.c:983 get_signal+0x368/0x1d10 kernel/signal.c:2729 do_signal+0x87/0x16c0 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x114/0x210 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x468/0x550 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881c6420440 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 488 bytes inside of 2048-byte region [ffff8881c6420440, ffff8881c6420c40) The buggy address belongs to the page: page:ffffea0007190800 refcount:1 mapcount:0 mapping:ffff8881da000e00 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0006f9af08 ffffea00071aa308 ffff8881da000e00 raw: 0000000000000000 ffff8881c6420440 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c6420500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c6420580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881c6420600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881c6420680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c6420700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================