syzbot


WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock

Status: upstream: reported C repro on 2024/09/15 22:26
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+2f2b61f2e80f27641e4b@syzkaller.appspotmail.com
First crash: 5d04h, last: 3d22h
Bug presence (1)
Date Name Commit Repro Result
2024/09/16 upstream (ToT) 98f7e32f20d2 C [report] WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock ocfs2 C 6 20h03m 10h01m 0/28 upstream: reported C repro on 2024/09/20 17:22
linux-6.1 WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock 2 4d01h 4d01h 0/3 upstream: reported on 2024/09/17 02:11

Sample crash report:
ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode.
(syz-executor308,4015,1):ocfs2_read_blocks:240 ERROR: status = -12
=====================================
WARNING: bad unlock balance detected!
5.15.167-syzkaller #0 Not tainted
-------------------------------------
syz-executor308/4015 is trying to release lock (&oi->ip_io_mutex) at:
[<ffff800009e04358>] ocfs2_inode_cache_io_unlock+0x20/0x30 fs/ocfs2/inode.c:1648
but there are no more locks to release!

other info that might help us debug this:
8 locks held by syz-executor308/4015:
 #0: ffff0000cbfca460 (sb_writers#8){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377
 #1: ffff0000e19289c8 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline]
 #1: ffff0000e19289c8 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x204/0x468 fs/namei.c:3835
 #2: ffff0000e19309c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
 #2: ffff0000e19309c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x164/0x416c fs/ocfs2/suballoc.c:782
 #3: ffff0000e192ed88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
 #3: ffff0000e192ed88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x164/0x416c fs/ocfs2/suballoc.c:782
 #4: ffff0000e1932648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
 #4: ffff0000e1932648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0xfc/0x2474 fs/ocfs2/localalloc.c:635
 #5: ffff0000cbfca650 (sb_internal#2){.+.+}-{0:0}, at: ocfs2_mknod+0xe68/0x24f8 fs/ocfs2/namei.c:359
 #6: ffff0000da2988e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x45c/0x804 fs/ocfs2/journal.c:352
 #7: ffff0000cbfc8990 (jbd2_handle){.+.+}-{0:0}, at: start_this_handle+0xf98/0x12a4 fs/jbd2/transaction.c:462

stack backtrace:
CPU: 1 PID: 4015 Comm: syz-executor308 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 print_unlock_imbalance_bug+0x250/0x2a4 kernel/locking/lockdep.c:5065
 lock_release+0x4b8/0xa1c kernel/locking/lockdep.c:5643
 __mutex_unlock_slowpath+0xe0/0x6d4 kernel/locking/mutex.c:851
 mutex_unlock+0x8c/0xe0 kernel/locking/mutex.c:536
 ocfs2_inode_cache_io_unlock+0x20/0x30 fs/ocfs2/inode.c:1648
 ocfs2_metadata_cache_io_unlock+0x6c/0x90 fs/ocfs2/uptodate.c:95
 ocfs2_read_blocks+0x1114/0x1628 fs/ocfs2/buffer_head_io.c:394
 ocfs2_read_block fs/ocfs2/buffer_head_io.h:52 [inline]
 ocfs2_read_group_descriptor fs/ocfs2/suballoc.c:299 [inline]
 ocfs2_search_chain+0x274/0x22f0 fs/ocfs2/suballoc.c:1757
 ocfs2_claim_suballoc_bits+0xd38/0x1d84 fs/ocfs2/suballoc.c:1930
 ocfs2_claim_new_inode+0x2cc/0x7a0 fs/ocfs2/suballoc.c:2210
 ocfs2_mknod_locked+0x134/0x2e4 fs/ocfs2/namei.c:633
 ocfs2_mknod+0x10b0/0x24f8 fs/ocfs2/namei.c:379
 vfs_mknod+0x3c8/0x448 fs/namei.c:3944
 do_mknodat+0x3c8/0x694
 __do_sys_mknodat fs/namei.c:4022 [inline]
 __se_sys_mknodat fs/namei.c:4019 [inline]
 __arm64_sys_mknodat+0xb0/0xcc fs/namei.c:4019
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
(syz-executor308,4015,1):ocfs2_search_chain:1761 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_search_chain:1871 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_claim_suballoc_bits:1940 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_claim_suballoc_bits:1983 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_claim_new_inode:2216 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_claim_new_inode:2231 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_mknod_locked:637 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_mknod:383 ERROR: status = -12
(syz-executor308,4015,1):ocfs2_mknod:500 ERROR: status = -12

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/15 22:45 linux-5.15.y 3a5928702e71 08d8a733 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock
2024/09/17 04:24 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock
2024/09/17 04:24 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock
2024/09/15 22:25 linux-5.15.y 3a5928702e71 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 WARNING: bad unlock balance in ocfs2_inode_cache_io_unlock
* Struck through repros no longer work on HEAD.