===================================== WARNING: bad unlock balance detected! 5.0.0-rc6-next-20190215 #36 Not tainted ------------------------------------- syz-executor.3/8691 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.3/8691: #0: 00000000414ece80 (&file->mut){+.+.}, at: ucma_destroy_id+0x1e9/0x4a0 drivers/infiniband/core/ucma.c:626 stack backtrace: CPU: 1 PID: 8691 Comm: syz-executor.3 Not tainted 5.0.0-rc6-next-20190215 #36 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:3376 [inline] print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3353 __lock_release kernel/locking/lockdep.c:3592 [inline] lock_release+0x67e/0xa00 kernel/locking/lockdep.c:3852 __mutex_unlock_slowpath+0x8e/0x6b0 kernel/locking/mutex.c:1197 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:713 ucma_destroy_id+0x24c/0x4a0 drivers/infiniband/core/ucma.c:628 ucma_write+0x2da/0x3c0 drivers/infiniband/core/ucma.c:1696 __vfs_write+0x8d/0x110 fs/read_write.c:485 vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457e29 Code: ad b8 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 b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f3503ba7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457e29 RDX: 0000000000000018 RSI: 0000000020000280 RDI: 000000000000000a RBP: 000000000073c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3503ba86d4 R13: 00000000004cd790 R14: 00000000004dc9d0 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:1206 Read of size 8 at addr ffff88800fd818c0 by task syz-executor.3/8691 CPU: 0 PID: 8691 Comm: syz-executor.3 Not tainted 5.0.0-rc6-next-20190215 #36 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:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 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:102 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:1206 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:713 ucma_destroy_id+0x24c/0x4a0 drivers/infiniband/core/ucma.c:628 ucma_write+0x2da/0x3c0 drivers/infiniband/core/ucma.c:1696 __vfs_write+0x8d/0x110 fs/read_write.c:485 vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457e29 Code: ad b8 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 b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f3503ba7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457e29 RDX: 0000000000000018 RSI: 0000000020000280 RDI: 000000000000000a RBP: 000000000073c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3503ba86d4 R13: 00000000004cd790 R14: 00000000004dc9d0 R15: 00000000ffffffff Allocated by task 8691: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3615 kmalloc include/linux/slab.h:548 [inline] ucma_open+0x4f/0x290 drivers/infiniband/core/ucma.c:1728 misc_open+0x398/0x4c0 drivers/char/misc.c:141 chrdev_open+0x247/0x6b0 fs/char_dev.c:417 do_dentry_open+0x488/0x1160 fs/open.c:771 vfs_open+0xa0/0xd0 fs/open.c:880 do_last fs/namei.c:3416 [inline] path_openat+0x10e9/0x46e0 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1063 __do_sys_openat fs/open.c:1090 [inline] __se_sys_openat fs/open.c:1084 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1084 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8231: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3491 [inline] kfree+0xcf/0x230 mm/slab.c:3816 ucma_close+0x291/0x320 drivers/infiniband/core/ucma.c:1787 __fput+0x2e5/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88800fd818c0 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff88800fd818c0, ffff88800fd819c0) The buggy address belongs to the page: page:ffffea00003f6040 count:1 mapcount:0 mapping:ffff88812c3f07c0 index:0xffff88800fd81280 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0000bd3c08 ffffea00024c9f08 ffff88812c3f07c0 raw: ffff88800fd81280 ffff88800fd81000 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88800fd81780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800fd81800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88800fd81880: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88800fd81900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800fd81980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================