================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xd6/0xf0 lib/list_debug.c:54 Read of size 8 at addr ffff88807592d8a0 by task syz-executor.3/22967 CPU: 0 PID: 22967 Comm: syz-executor.3 Not tainted 4.14.229-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+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430 __list_del_entry_valid+0xd6/0xf0 lib/list_debug.c:54 __list_del_entry include/linux/list.h:117 [inline] list_del include/linux/list.h:125 [inline] cma_cancel_listens drivers/infiniband/core/cma.c:1607 [inline] cma_cancel_operation drivers/infiniband/core/cma.c:1635 [inline] cma_cancel_operation+0x285/0x950 drivers/infiniband/core/cma.c:1623 rdma_destroy_id+0x84/0xb60 drivers/infiniband/core/cma.c:1699 ucma_close+0x11a/0x340 drivers/infiniband/core/ucma.c:1753 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 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+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x41926b RSP: 002b:00007fff142d4ce0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 000000000041926b RDX: 00000000005707b8 RSI: 00007ff7391464f0 RDI: 0000000000000003 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000001b2eb24ce4 R10: 00007fff142d4dd0 R11: 0000000000000293 R12: 00000000001ffbf5 R13: 00000000000003e8 R14: 000000000056bf60 R15: 00000000001ffbc7 Allocated by task 22953: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] rdma_create_id+0x57/0x4c0 drivers/infiniband/core/cma.c:790 ucma_create_id+0x18b/0x500 drivers/infiniband/core/ucma.c:484 ucma_write+0x206/0x2c0 drivers/infiniband/core/ucma.c:1672 __vfs_write+0xe4/0x630 fs/read_write.c:480 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 22953: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 ucma_close+0x11a/0x340 drivers/infiniband/core/ucma.c:1753 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 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+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff88807592d6c0 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 480 bytes inside of 1024-byte region [ffff88807592d6c0, ffff88807592dac0) The buggy address belongs to the page: page:ffffea0001d64b00 count:1 mapcount:0 mapping:ffff88807592c040 index:0xffff88807592c4c0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffff88807592c040 ffff88807592c4c0 0000000100000004 raw: ffffea0001e39f20 ffffea00027a2ba0 ffff88813fe80ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88807592d780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807592d800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807592d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807592d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807592d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================