syzbot


WARNING: bad unlock balance in ocfs2_read_blocks

Status: upstream: reported on 2024/09/17 05:01
Reported-by: syzbot+213c33114cacb17f4d01@syzkaller.appspotmail.com
First crash: 67d, last: 47d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 WARNING: bad unlock balance in ocfs2_read_blocks origin:upstream C done 10 47d 66d 3/3 fixed on 2024/11/11 09:26
upstream WARNING: bad unlock balance in ocfs2_read_blocks ocfs2 C 240 64d 96d 28/28 fixed on 2024/10/22 11:57

Sample crash report:
(syz.3.122,4297,1):ocfs2_read_blocks:240 ERROR: status = -12
=====================================
WARNING: bad unlock balance detected!
6.1.112-syzkaller #0 Not tainted
-------------------------------------
syz.3.122/4297 is trying to release lock (&oi->ip_io_mutex) at:
[<ffffffff835bbe6f>] ocfs2_read_blocks+0x11ef/0x16e0 fs/ocfs2/buffer_head_io.c:394
but there are no more locks to release!

other info that might help us debug this:
3 locks held by syz.3.122/4297:
 #0: ffff88806614a0e0 (&type->s_umount_key#57/1){+.+.}-{3:3}, at: alloc_super+0x217/0x930 fs/super.c:228
 #1: ffff88805d175488 (&osb->system_file_mutex){+.+.}-{3:3}, at: ocfs2_get_system_file_inode+0x1a1/0x7b0 fs/ocfs2/sysfile.c:101
 #2: ffff8880606f14a0 (&ocfs2_file_ip_alloc_sem_key){.+.+}-{3:3}, at: ocfs2_read_virt_blocks+0x2dc/0xab0 fs/ocfs2/extent_map.c:976

stack backtrace:
CPU: 1 PID: 4297 Comm: syz.3.122 Not tainted 6.1.112-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/0x2cb lib/dump_stack.c:106
 print_unlock_imbalance_bug+0x24e/0x2c0 kernel/locking/lockdep.c:5102
 __lock_release kernel/locking/lockdep.c:5339 [inline]
 lock_release+0x5ad/0xa20 kernel/locking/lockdep.c:5682
 __mutex_unlock_slowpath+0xde/0x750 kernel/locking/mutex.c:907
 ocfs2_read_blocks+0x11ef/0x16e0 fs/ocfs2/buffer_head_io.c:394
 ocfs2_read_block fs/ocfs2/buffer_head_io.h:52 [inline]
 ocfs2_read_extent_block fs/ocfs2/alloc.c:934 [inline]
 __ocfs2_find_path+0x2f9/0x7e0 fs/ocfs2/alloc.c:1835
 ocfs2_find_leaf+0xcb/0x220 fs/ocfs2/alloc.c:1931
 ocfs2_get_clusters_nocache+0x1a9/0xbe0 fs/ocfs2/extent_map.c:418
 ocfs2_get_clusters+0x5b5/0xbc0 fs/ocfs2/extent_map.c:621
 ocfs2_extent_map_get_blocks+0x248/0x7d0 fs/ocfs2/extent_map.c:668
 ocfs2_read_virt_blocks+0x313/0xab0 fs/ocfs2/extent_map.c:977
 ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline]
 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline]
 ocfs2_find_entry+0x436/0x28c0 fs/ocfs2/dir.c:1080
 ocfs2_find_files_on_disk+0x10d/0x3a0 fs/ocfs2/dir.c:1982
 ocfs2_lookup_ino_from_name+0xad/0x1e0 fs/ocfs2/dir.c:2004
 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline]
 ocfs2_get_system_file_inode+0x314/0x7b0 fs/ocfs2/sysfile.c:112
 ocfs2_init_global_system_inodes+0x328/0x720 fs/ocfs2/super.c:457
 ocfs2_initialize_super fs/ocfs2/super.c:2250 [inline]
 ocfs2_fill_super+0x2f82/0x5730 fs/ocfs2/super.c:994
 mount_bdev+0x2c9/0x3f0 fs/super.c:1443
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:632
 vfs_get_tree+0x88/0x270 fs/super.c:1573
 do_new_mount+0x2ba/0xb40 fs/namespace.c:3051
 do_mount fs/namespace.c:3394 [inline]
 __do_sys_mount fs/namespace.c:3602 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3579
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1e4017f79a
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:00007f1e40f5be68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f1e40f5bef0 RCX: 00007f1e4017f79a
RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f1e40f5beb0
RBP: 0000000020004440 R08: 00007f1e40f5bef0 R09: 0000000001000000
R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780
R13: 00007f1e40f5beb0 R14: 000000000000444a R15: 00000000200005c0
 </TASK>
(syz.3.122,4297,0):__ocfs2_find_path:1837 ERROR: status = -12
(syz.3.122,4297,0):ocfs2_find_leaf:1933 ERROR: status = -12
(syz.3.122,4297,0):ocfs2_get_clusters_nocache:421 ERROR: status = -12
(syz.3.122,4297,0):ocfs2_get_clusters:624 ERROR: status = -12
(syz.3.122,4297,0):ocfs2_extent_map_get_blocks:671 ERROR: status = -12
(syz.3.122,4297,0):ocfs2_read_virt_blocks:981 ERROR: status = -12
(syz.3.122,4297,0):ocfs2_read_dir_block:511 ERROR: status = -12
(syz.3.122,4297,0):ocfs2_init_global_system_inodes:461 ERROR: status = -22
(syz.3.122,4297,0):ocfs2_init_global_system_inodes:463 ERROR: Unable to load system inode 1, possibly corrupt fs?
(syz.3.122,4297,0):ocfs2_init_global_system_inodes:472 ERROR: status = -22
(syz.3.122,4297,0):ocfs2_initialize_super:2252 ERROR: status = -22
(syz.3.122,4297,0):ocfs2_fill_super:1176 ERROR: status = -22

Crashes (18):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/07 07:23 linux-6.1.y aa4cd140bba5 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/28 20:31 linux-6.1.y e526b12bf916 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/28 20:31 linux-6.1.y e526b12bf916 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/28 20:27 linux-6.1.y e526b12bf916 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/28 20:25 linux-6.1.y e526b12bf916 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/28 19:31 linux-6.1.y e526b12bf916 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/26 20:36 linux-6.1.y e526b12bf916 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/26 10:14 linux-6.1.y e526b12bf916 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/26 10:08 linux-6.1.y e526b12bf916 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/26 10:06 linux-6.1.y e526b12bf916 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/26 10:04 linux-6.1.y e526b12bf916 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/26 10:04 linux-6.1.y e526b12bf916 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/24 11:08 linux-6.1.y e526b12bf916 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/24 11:08 linux-6.1.y e526b12bf916 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/24 04:57 linux-6.1.y e526b12bf916 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/24 04:57 linux-6.1.y e526b12bf916 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/17 05:01 linux-6.1.y 5f55cad62cc9 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
2024/09/17 05:00 linux-6.1.y 5f55cad62cc9 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan WARNING: bad unlock balance in ocfs2_read_blocks
* Struck through repros no longer work on HEAD.