syzbot


WARNING: bad unlock balance in ocfs2_read_blocks

Status: fixed on 2024/11/11 09:26
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+b8e798849d67a7d4917a@syzkaller.appspotmail.com
Fix commit: f55a33fe0fb5 ocfs2: remove unreasonable unlock in ocfs2_read_blocks
First crash: 66d, last: 47d
Fix bisection: fixed by (bisect log) :
commit f55a33fe0fb5274ef185fd61947cf142138958af
Author: Lizhi Xu <lizhi.xu@windriver.com>
Date: Mon Sep 2 02:36:35 2024 +0000

  ocfs2: remove unreasonable unlock in ocfs2_read_blocks

  
Bug presence (1)
Date Name Commit Repro Result
2024/09/17 upstream (ToT) 2f27fce67173 C [report] WARNING: bad unlock balance in ocfs2_read_blocks
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 WARNING: bad unlock balance in ocfs2_read_blocks 18 47d 67d 0/3 upstream: reported on 2024/09/17 05:01
upstream WARNING: bad unlock balance in ocfs2_read_blocks ocfs2 C 240 64d 96d 28/28 fixed on 2024/10/22 11:57
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/10/23 14:54 16m retest repro linux-5.15.y OK log

Sample crash report:
loop3: detected capacity change from 0 to 32768
(syz.3.1155,10665,1):ocfs2_read_blocks:240 ERROR: status = -12
=====================================
WARNING: bad unlock balance detected!
5.15.167-syzkaller #0 Not tainted
-------------------------------------
syz.3.1155/10665 is trying to release lock (&oi->ip_io_mutex
) at:
[<ffffffff8333943d>] ocfs2_read_blocks+0x108d/0x1490 fs/ocfs2/buffer_head_io.c:394
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz.3.1155/10665:
 #0: ffff888076c0e0e0 (&type->s_umount_key#50/1){+.+.}-{3:3}, at: alloc_super+0x210/0x940 fs/super.c:229

stack backtrace:
CPU: 0 PID: 10665 Comm: syz.3.1155 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_unlock_imbalance_bug+0x248/0x2b0 kernel/locking/lockdep.c:5065
 __lock_release kernel/locking/lockdep.c:5302 [inline]
 lock_release+0x596/0x9a0 kernel/locking/lockdep.c:5643
 __mutex_unlock_slowpath+0xde/0x750 kernel/locking/mutex.c:851
 ocfs2_read_blocks+0x108d/0x1490 fs/ocfs2/buffer_head_io.c:394
 ocfs2_map_slot_buffers fs/ocfs2/slot_map.c:385 [inline]
 ocfs2_init_slot_info+0xae4/0x1350 fs/ocfs2/slot_map.c:424
 ocfs2_initialize_super fs/ocfs2/super.c:2300 [inline]
 ocfs2_fill_super+0x48ea/0x58a0 fs/ocfs2/super.c:995
 mount_bdev+0x2c9/0x3f0 fs/super.c:1398
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1528
 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005
 do_mount fs/namespace.c:3348 [inline]
 __do_sys_mount fs/namespace.c:3556 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f3331ece79a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3330344e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f3330344ef0 RCX: 00007f3331ece79a
RDX: 0000000020004440 RSI: 0000000020000000 RDI: 00007f3330344eb0
RBP: 0000000020004440 R08: 00007f3330344ef0 R09: 00000000000008c0
R10: 00000000000008c0 R11: 0000000000000246 R12: 0000000020000000
R13: 00007f3330344eb0 R14: 0000000000004451 R15: 0000000020000280
 </TASK>
(syz.3.1155,10665,1):ocfs2_map_slot_buffers:388 ERROR: status = -12
(syz.3.1155,10665,1):ocfs2_init_slot_info:426 ERROR: status = -12
(syz.3.1155,10665,0):ocfs2_initialize_super:2302 ERROR: status = -12
(syz.3.1155,10665,0):ocfs2_fill_super:1177 ERROR: status = -12

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/07 05:42 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/10/06 01:26 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/10/03 12:43 linux-5.15.y 3a5928702e71 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/22 09:37 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/22 09:37 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/21 13:07 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/21 13:06 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/17 16:57 linux-5.15.y 3a5928702e71 c673ca06 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/17 16:47 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/17 16:46 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in ocfs2_read_blocks
* Struck through repros no longer work on HEAD.