===================================== WARNING: bad unlock balance detected! 5.6.0-rc2-syzkaller #0 Not tainted ------------------------------------- syz-executor.0/8852 is trying to release lock (&file->mut) at: [] ucma_destroy_id+0x212/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.0/8852: #0: ffff88808a765860 (&file->mut){+.+.}, at: ucma_destroy_id+0x1d1/0x400 drivers/infiniband/core/ucma.c:619 stack backtrace: CPU: 0 PID: 8852 Comm: syz-executor.0 Not tainted 5.6.0-rc2-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+0x1fb/0x318 lib/dump_stack.c:118 print_unlock_imbalance_bug+0x20b/0x240 kernel/locking/lockdep.c:4007 __lock_release kernel/locking/lockdep.c:4241 [inline] lock_release+0x469/0x710 kernel/locking/lockdep.c:4502 __mutex_unlock_slowpath+0x80/0x5b0 kernel/locking/mutex.c:1228 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:740 ucma_destroy_id+0x212/0x400 drivers/infiniband/core/ucma.c:621 ucma_write+0x2da/0x360 drivers/infiniband/core/ucma.c:1684 __vfs_write+0xb8/0x740 fs/read_write.c:494 vfs_write+0x270/0x580 fs/read_write.c:558 ksys_write+0x117/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+0x7b/0x90 fs/read_write.c:620 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c449 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:00007f538ab4ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f538ab4f6d4 RCX: 000000000045c449 RDX: 0000000000000018 RSI: 0000000020001380 RDI: 0000000000000003 RBP: 000000000076bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000c8a R14: 00000000004d7660 R15: 000000000076bfcc ================================================================== BUG: KASAN: use-after-free in atomic64_read include/asm-generic/atomic-instrumented.h:836 [inline] BUG: KASAN: use-after-free in atomic_long_read include/asm-generic/atomic-long.h:28 [inline] BUG: KASAN: use-after-free in __mutex_unlock_slowpath+0x8d/0x5b0 kernel/locking/mutex.c:1237 Read of size 8 at addr ffff888094ca3a00 by task syz-executor.0/8852 CPU: 0 PID: 8852 Comm: syz-executor.0 Not tainted 5.6.0-rc2-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+0x1fb/0x318 lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:374 __kasan_report+0x149/0x1c0 mm/kasan/report.c:506 kasan_report+0x26/0x50 mm/kasan/common.c:641 check_memory_region_inline mm/kasan/generic.c:182 [inline] check_memory_region+0x2b6/0x2f0 mm/kasan/generic.c:192 __kasan_check_read+0x11/0x20 mm/kasan/common.c:95 atomic64_read include/asm-generic/atomic-instrumented.h:836 [inline] atomic_long_read include/asm-generic/atomic-long.h:28 [inline] __mutex_unlock_slowpath+0x8d/0x5b0 kernel/locking/mutex.c:1237 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:740 ucma_destroy_id+0x212/0x400 drivers/infiniband/core/ucma.c:621 ucma_write+0x2da/0x360 drivers/infiniband/core/ucma.c:1684 __vfs_write+0xb8/0x740 fs/read_write.c:494 vfs_write+0x270/0x580 fs/read_write.c:558 ksys_write+0x117/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+0x7b/0x90 fs/read_write.c:620 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c449 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:00007f538ab4ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f538ab4f6d4 RCX: 000000000045c449 RDX: 0000000000000018 RSI: 0000000020001380 RDI: 0000000000000003 RBP: 000000000076bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000c8a R14: 00000000004d7660 R15: 000000000076bfcc Allocated by task 8852: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc+0x118/0x1c0 mm/kasan/common.c:515 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 kmem_cache_alloc_trace+0x221/0x2f0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] ucma_open+0x57/0x1f0 drivers/infiniband/core/ucma.c:1716 misc_open+0x3ea/0x440 drivers/char/misc.c:141 chrdev_open+0x509/0x590 fs/char_dev.c:414 do_dentry_open+0x85b/0x10c0 fs/open.c:797 vfs_open+0x73/0x80 fs/open.c:914 do_last fs/namei.c:3490 [inline] path_openat+0x16f1/0x4380 fs/namei.c:3607 do_filp_open+0x192/0x3d0 fs/namei.c:3637 do_sys_openat2+0x42b/0x6f0 fs/open.c:1149 do_sys_open fs/open.c:1165 [inline] __do_sys_openat fs/open.c:1179 [inline] __se_sys_openat fs/open.c:1174 [inline] __x64_sys_openat+0x1e6/0x210 fs/open.c:1174 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8846: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x12e/0x1e0 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10d/0x220 mm/slab.c:3757 ucma_close+0x2b3/0x2d0 drivers/infiniband/core/ucma.c:1772 __fput+0x2e4/0x740 fs/file_table.c:280 ____fput+0x15/0x20 fs/file_table.c:313 task_work_run+0x176/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop arch/x86/entry/common.c:164 [inline] prepare_exit_to_usermode+0x480/0x5b0 arch/x86/entry/common.c:195 syscall_return_slowpath+0x113/0x4a0 arch/x86/entry/common.c:278 do_syscall_64+0x11f/0x1c0 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888094ca3a00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff888094ca3a00, ffff888094ca3b00) The buggy address belongs to the page: page:ffffea00025328c0 refcount:1 mapcount:0 mapping:ffff8880aa4008c0 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea000229d948 ffff8880aa401648 ffff8880aa4008c0 raw: 0000000000000000 ffff888094ca3000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888094ca3900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888094ca3980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888094ca3a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888094ca3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094ca3b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================