===================================== WARNING: bad unlock balance detected! 5.5.0-rc6-syzkaller #0 Not tainted ------------------------------------- syz-executor.5/10209 is trying to release lock (&file->mut) at: [] ucma_destroy_id+0x23e/0x400 drivers/infiniband/core/ucma.c:621 but there are no more locks to release! other info that might help us debug this: 1 lock held by syz-executor.5/10209: #0: ffff88809f5b1260 (&file->mut){+.+.}, at: ucma_destroy_id+0x1de/0x400 drivers/infiniband/core/ucma.c:619 stack backtrace: CPU: 0 PID: 10209 Comm: syz-executor.5 Not tainted 5.5.0-rc6-syzkaller #0 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+0x12d/0x187 lib/dump_stack.c:118 print_unlock_imbalance_bug.cold.53+0x114/0x123 kernel/locking/lockdep.c:4008 __lock_release kernel/locking/lockdep.c:4242 [inline] lock_release+0x60e/0x910 kernel/locking/lockdep.c:4503 __mutex_unlock_slowpath+0x86/0x690 kernel/locking/mutex.c:1228 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:740 ucma_destroy_id+0x23e/0x400 drivers/infiniband/core/ucma.c:621 ucma_write+0x203/0x2d0 drivers/infiniband/core/ucma.c:1684 __vfs_write+0x5e/0x110 fs/read_write.c:494 vfs_write+0x18a/0x520 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+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a679 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2889d0ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a679 RDX: 0000000000000018 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2889d0f6d4 R13: 00000000004d2b38 R14: 00000000004e3be0 R15: 00000000ffffffff ================================================================== BUG: KASAN: use-after-free in ucma_destroy_id+0x3ca/0x400 drivers/infiniband/core/ucma.c:623 Read of size 8 at addr ffff88809ff4c668 by task syz-executor.5/10209 CPU: 0 PID: 10209 Comm: syz-executor.5 Not tainted 5.5.0-rc6-syzkaller #0 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+0x12d/0x187 lib/dump_stack.c:118 print_address_description.constprop.8.cold.10+0x9/0x31d mm/kasan/report.c:374 __kasan_report.cold.11+0x1b/0x3a mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 ucma_destroy_id+0x3ca/0x400 drivers/infiniband/core/ucma.c:623 ucma_write+0x203/0x2d0 drivers/infiniband/core/ucma.c:1684 __vfs_write+0x5e/0x110 fs/read_write.c:494 vfs_write+0x18a/0x520 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+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a679 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2889d0ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a679 RDX: 0000000000000018 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2889d0f6d4 R13: 00000000004d2b38 R14: 00000000004e3be0 R15: 00000000ffffffff Allocated by task 10185: save_stack+0x21/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc.constprop.13+0xc7/0xd0 mm/kasan/common.c:513 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 kmem_cache_alloc_trace+0x15b/0x780 mm/slab.c:3551 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:670 [inline] ucma_alloc_ctx+0x4c/0x430 drivers/infiniband/core/ucma.c:210 ucma_create_id+0xeb/0x550 drivers/infiniband/core/ucma.c:495 ucma_write+0x203/0x2d0 drivers/infiniband/core/ucma.c:1684 __vfs_write+0x5e/0x110 fs/read_write.c:494 vfs_write+0x18a/0x520 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+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 10170: save_stack+0x21/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kfree+0x108/0x2c0 mm/slab.c:3757 ucma_free_ctx+0x7a0/0xd50 drivers/infiniband/core/ucma.c:592 ucma_close+0x109/0x2d0 drivers/infiniband/core/ucma.c:1767 __fput+0x25a/0x770 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x108/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x24e/0x2e0 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x4ff/0x5f0 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809ff4c600 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 104 bytes inside of 256-byte region [ffff88809ff4c600, ffff88809ff4c700) The buggy address belongs to the page: page:ffffea00027fd300 refcount:1 mapcount:0 mapping:ffff8880aa4008c0 index:0x0 raw: 00fffe0000000200 ffffea0002959a48 ffffea00028e1988 ffff8880aa4008c0 raw: 0000000000000000 ffff88809ff4c000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809ff4c500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809ff4c580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809ff4c600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809ff4c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809ff4c700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================