================================================================== BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:938 [inline] BUG: KASAN: use-after-free in __mutex_lock+0x1033/0x13c0 kernel/locking/mutex.c:1103 Read of size 8 at addr ffff88804c6103b0 by task kworker/u4:2/56 CPU: 0 PID: 56 Comm: kworker/u4:2 Not tainted 5.6.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: ib_addr process_one_req Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382 __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511 kasan_report+0x33/0x50 mm/kasan/common.c:625 __mutex_lock_common kernel/locking/mutex.c:938 [inline] __mutex_lock+0x1033/0x13c0 kernel/locking/mutex.c:1103 addr_handler+0xa0/0x340 drivers/infiniband/core/cma.c:3100 process_one_req+0xfa/0x680 drivers/infiniband/core/addr.c:643 process_one_work+0x965/0x16a0 kernel/workqueue.c:2266 worker_thread+0x96/0xe20 kernel/workqueue.c:2412 kthread+0x388/0x470 kernel/kthread.c:268 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 12239: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc mm/kasan/common.c:495 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:468 kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] __rdma_create_id+0x5b/0x850 drivers/infiniband/core/cma.c:861 ucma_create_id+0x1d1/0x590 drivers/infiniband/core/ucma.c:503 ucma_write+0x285/0x350 drivers/infiniband/core/ucma.c:1729 __vfs_write+0x76/0x100 fs/read_write.c:494 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x1ee/0x250 fs/read_write.c:611 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 12236: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:456 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 ucma_close+0x111/0x300 drivers/infiniband/core/ucma.c:1807 __fput+0x33e/0x880 fs/file_table.c:280 task_work_run+0xf4/0x1b0 kernel/task_work.c:123 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x2fa/0x360 arch/x86/entry/common.c:165 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x6b1/0x7d0 arch/x86/entry/common.c:305 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff88804c610000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 944 bytes inside of 2048-byte region [ffff88804c610000, ffff88804c610800) The buggy address belongs to the page: page:ffffea0001318400 refcount:1 mapcount:0 mapping:0000000009248fe3 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00025d0948 ffffea000280acc8 ffff8880aa000e00 raw: 0000000000000000 ffff88804c610000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804c610280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804c610300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804c610380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804c610400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804c610480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================