syzbot


WARNING: bad unlock balance in swap_inode_boot_loader

Status: upstream: reported C repro on 2025/12/26 21:38
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+7ba223fef4125a07cc4b@syzkaller.appspotmail.com
First crash: 12d, last: 12d
Bug presence (1)
Date Name Commit Repro Result
2025/12/27 upstream (ToT) d26143bb38e2 C [report] WARNING in lock_two_nondirectories

Sample crash report:
EXT4-fs (loop0): 1 truncate cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: jqfmt=vfsold,resgid=0x000000000000ee00,bh,noload,data_err=ignore,usrjquota=,,errors=continue. Quota mode: none.
=====================================
WARNING: bad unlock balance detected!
syzkaller #0 Not tainted
-------------------------------------
syz.0.17/4437 is trying to release lock (&type->i_mutex_dir_key) at:
[<ffffffff820a7110>] swap_inode_boot_loader+0x310/0x10f0 fs/ext4/ioctl.c:262
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz.0.17/4437:
 #0: ffff88807bc04460 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:430

stack backtrace:
CPU: 1 PID: 4437 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 __lock_release kernel/locking/lockdep.c:5302 [inline]
 lock_release+0x52f/0x870 kernel/locking/lockdep.c:5643
 up_write+0x29/0x420 kernel/locking/rwsem.c:1603
 swap_inode_boot_loader+0x310/0x10f0 fs/ext4/ioctl.c:262
 __ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
 ext4_ioctl+0x18f3/0x3590 fs/ext4/ioctl.c:1282
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fce1e634749
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd1a3eb6e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fce1e88afa0 RCX: 00007fce1e634749
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007fce1e6b8f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fce1e88afa0 R14: 00007fce1e88afa0 R15: 0000000000000003
 </TASK>
------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff888069165d38, owner = 0x0, curr 0xffff88807de58000, list empty
WARNING: CPU: 1 PID: 4437 at kernel/locking/rwsem.c:1350 __up_write kernel/locking/rwsem.c:1349 [inline]
WARNING: CPU: 1 PID: 4437 at kernel/locking/rwsem.c:1350 up_write+0x3a1/0x420 kernel/locking/rwsem.c:1604
Modules linked in:
CPU: 1 PID: 4437 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
RIP: 0010:__up_write kernel/locking/rwsem.c:1349 [inline]
RIP: 0010:up_write+0x3a1/0x420 kernel/locking/rwsem.c:1604
Code: 44 d0 48 c7 c7 60 0f 0b 8a 48 c7 c6 20 12 0b 8a 48 8b 14 24 4c 89 f1 4d 89 e0 4c 8b 4c 24 08 41 52 e8 c3 d0 3b 08 48 83 c4 08 <0f> 0b e9 6b fd ff ff 48 c7 c1 48 69 69 8d 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc9000325f950 EFLAGS: 00010296
RAX: 6a1c4ce19e5e3700 RBX: ffff888069165d38 RCX: ffff88807de58000
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: dffffc0000000000 R08: dffffc0000000000 R09: ffffed10172267b0
R10: ffffed10172267b0 R11: 1ffff110172267af R12: 0000000000000000
R13: ffff888069165d90 R14: ffff888069165d38 R15: 1ffff1100d22cba8
FS:  000055556b80c500(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000024566000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 swap_inode_boot_loader+0x310/0x10f0 fs/ext4/ioctl.c:262
 __ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
 ext4_ioctl+0x18f3/0x3590 fs/ext4/ioctl.c:1282
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fce1e634749
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd1a3eb6e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fce1e88afa0 RCX: 00007fce1e634749
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007fce1e6b8f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fce1e88afa0 R14: 00007fce1e88afa0 R15: 0000000000000003
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/12/27 00:54 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan WARNING: bad unlock balance in swap_inode_boot_loader
2025/12/26 22:15 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan WARNING: bad unlock balance in swap_inode_boot_loader
2025/12/26 21:38 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan WARNING: bad unlock balance in swap_inode_boot_loader
* Struck through repros no longer work on HEAD.