===================================== WARNING: bad unlock balance detected! 5.2.0-rc6+ #34 Not tainted ------------------------------------- syz-executor.0/10066 is trying to release lock (&file->mut) at: [] ucma_destroy_id+0x24c/0x4a0 drivers/infiniband/core/ucma.c:628 but there are no more locks to release! other info that might help us debug this: 1 lock held by syz-executor.0/10066: #0: 00000000ff96814c (&file->mut){+.+.}, at: ucma_destroy_id+0x1e9/0x4a0 drivers/infiniband/core/ucma.c:626 stack backtrace: CPU: 1 PID: 10066 Comm: syz-executor.0 Not tainted 5.2.0-rc6+ #34 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+0x172/0x1f0 lib/dump_stack.c:113 print_unlock_imbalance_bug kernel/locking/lockdep.c:3846 [inline] print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3823 __lock_release kernel/locking/lockdep.c:4062 [inline] lock_release+0x67b/0xa00 kernel/locking/lockdep.c:4322 __mutex_unlock_slowpath+0x8e/0x6b0 kernel/locking/mutex.c:1198 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:714 ucma_destroy_id+0x24c/0x4a0 drivers/infiniband/core/ucma.c:628 ucma_write+0x2d7/0x3c0 drivers/infiniband/core/ucma.c:1696 __vfs_write+0x8a/0x110 fs/read_write.c:494 vfs_write+0x20c/0x580 fs/read_write.c:558 ksys_write+0x220/0x290 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+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459519 Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f85f158dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459519 RDX: 0000000000000018 RSI: 0000000020000200 RDI: 0000000000000003 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f85f158e6d4 R13: 00000000004d0138 R14: 00000000004e02c8 R15: 00000000ffffffff ================================================================== 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+0x9b/0x6b0 kernel/locking/mutex.c:1207 Read of size 8 at addr ffff88808e958a80 by task syz-executor.0/10066 CPU: 0 PID: 10066 Comm: syz-executor.0 Not tainted 5.2.0-rc6+ #34 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 kasan_check_read+0x11/0x20 mm/kasan/common.c:94 atomic64_read include/asm-generic/atomic-instrumented.h:836 [inline] atomic_long_read include/asm-generic/atomic-long.h:28 [inline] __mutex_unlock_slowpath+0x9b/0x6b0 kernel/locking/mutex.c:1207 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:714 ucma_destroy_id+0x24c/0x4a0 drivers/infiniband/core/ucma.c:628 ucma_write+0x2d7/0x3c0 drivers/infiniband/core/ucma.c:1696 __vfs_write+0x8a/0x110 fs/read_write.c:494 vfs_write+0x20c/0x580 fs/read_write.c:558 ksys_write+0x220/0x290 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+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459519 Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f85f158dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459519 RDX: 0000000000000018 RSI: 0000000020000200 RDI: 0000000000000003 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f85f158e6d4 R13: 00000000004d0138 R14: 00000000004e02c8 R15: 00000000ffffffff Allocated by task 10057: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503 kmem_cache_alloc_trace+0x151/0x750 mm/slab.c:3555 kmalloc include/linux/slab.h:547 [inline] ucma_open+0x4f/0x290 drivers/infiniband/core/ucma.c:1728 misc_open+0x395/0x4c0 drivers/char/misc.c:141 chrdev_open+0x245/0x6b0 fs/char_dev.c:413 do_dentry_open+0x4df/0x1250 fs/open.c:778 vfs_open+0xa0/0xd0 fs/open.c:887 do_last fs/namei.c:3416 [inline] path_openat+0x10e9/0x46d0 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1070 __do_sys_openat fs/open.c:1097 [inline] __se_sys_openat fs/open.c:1091 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1091 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 10049: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kfree+0xcf/0x220 mm/slab.c:3755 ucma_close+0x291/0x320 drivers/infiniband/core/ucma.c:1787 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:185 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:168 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x58e/0x680 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808e958a80 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff88808e958a80, ffff88808e958b80) The buggy address belongs to the page: page:ffffea00023a5600 refcount:1 mapcount:0 mapping:ffff8880aa4007c0 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00026d3108 ffff8880aa401648 ffff8880aa4007c0 raw: 0000000000000000 ffff88808e958080 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808e958980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808e958a00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808e958a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808e958b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808e958b80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ==================================================================