syzbot


WARNING: bad unlock balance in ucma_destroy_id

Status: upstream: reported C repro on 2019/06/27 11:05
Reported-by: syzbot+bab3ddce7ee3bc34ccd4@syzkaller.appspotmail.com
First crash: 1319d, last: 41d

Fix bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: bad unlock balance in ucma_destroy_id syz done 44 1068d 1622d 17/24 fixed on 2020/05/10 10:42
linux-4.14 WARNING: bad unlock balance in ucma_destroy_id C inconclusive 12 41d 1315d 0/1 upstream: reported C repro on 2019/07/01 17:24

Sample crash report:
=====================================
WARNING: bad unlock balance detected!
4.19.211-syzkaller #0 Not tainted
-------------------------------------
syz-executor362/8161 is trying to release lock (&file->mut) at:
[<ffffffff85f61bf1>] ucma_destroy_id+0x221/0x4a0 drivers/infiniband/core/ucma.c:631
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor362/8161:
 #0: 000000004aad7ca1 (&file->mut){+.+.}, at: ucma_destroy_id+0x1c2/0x4a0 drivers/infiniband/core/ucma.c:629

stack backtrace:
CPU: 1 PID: 8161 Comm: syz-executor362 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_unlock_imbalance_bug kernel/locking/lockdep.c:149 [inline]
 __lock_release kernel/locking/lockdep.c:3679 [inline]
 lock_release.cold+0xe/0x4a kernel/locking/lockdep.c:3927
 __mutex_unlock_slowpath+0x89/0x610 kernel/locking/mutex.c:1203
 ucma_destroy_id+0x221/0x4a0 drivers/infiniband/core/ucma.c:631
 ucma_write+0x288/0x350 drivers/infiniband/core/ucma.c:1738
 __vfs_write+0xf7/0x770 fs/read_write.c:485
 vfs_write+0x1f3/0x540 fs/read_write.c:549
 ksys_write+0x12b/0x2a0 fs/read_write.c:599
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fc90e5c9a39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc90e55a308 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc90e651418 RCX: 00007fc90e5c9a39
RDX: 0000000000000018 RSI: 0000000020000280 RDI: 0000000000000003
RBP: 00007fc90e651410 R08: 00007fc90e55a700 R09: 0000000000000000
R10: 00007fc90e55a700 R11: 0000000000000246 R12: 00007fc90e65141c
R13: 00007fc90e61f074 R14: 006d635f616d6472 R15: 0000000000022000

Crashes (7):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci2-linux-4-19 2022/12/26 02:38 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] WARNING: bad unlock balance in ucma_destroy_id
ci2-linux-4-19 2022/09/09 05:09 linux-4.19.y 3f8a27f9e27b f3027468 .config console log report syz C WARNING: bad unlock balance in ucma_destroy_id
ci2-linux-4-19 2021/01/28 14:32 linux-4.19.y c4ff839de17f eefc07f2 .config console log report syz WARNING: bad unlock balance in ucma_destroy_id
ci2-linux-4-19 2020/02/18 11:08 linux-4.19.y 9b15f7fae677 1ce142dc .config console log report syz
ci2-linux-4-19 2019/11/29 23:00 linux-4.19.y 14260788bbb9 4f7e1d0f .config console log report syz
ci2-linux-4-19 2019/06/27 10:48 linux-4.19.y aec3002d07fd 7509bf36 .config console log report syz
ci2-linux-4-19 2019/06/27 10:04 linux-4.19.y aec3002d07fd 7509bf36 .config console log report
* Struck through repros no longer work on HEAD.