[v5.15] WARNING: bad unlock balance in ext4_ioctl

0 views
Skip to first unread message

syzbot

unread,
Dec 11, 2023, 8:43:26 AM12/11/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8a1d809b0545 Linux 5.15.142
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11bba9a2e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=ee92f7141049e8f2
dashboard link: https://syzkaller.appspot.com/bug?extid=77a0245eb4ed995150a6
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8965895d90e2/disk-8a1d809b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f8d2c2cd9799/vmlinux-8a1d809b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4fa328be23e7/bzImage-8a1d809b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+77a024...@syzkaller.appspotmail.com

EXT4-fs (loop3): 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!
5.15.142-syzkaller #0 Not tainted
-------------------------------------
syz-executor.3/4174 is trying to release lock (&type->i_mutex_dir_key) at:
[<ffffffff821e15ba>] swap_inode_boot_loader fs/ext4/ioctl.c:262 [inline]
[<ffffffff821e15ba>] __ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
[<ffffffff821e15ba>] ext4_ioctl+0x285a/0x5b80 fs/ext4/ioctl.c:1276
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor.3/4174:
#0: ffff888078b06460 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write_file+0x5a/0x1f0 fs/namespace.c:421

stack backtrace:
CPU: 1 PID: 4174 Comm: syz-executor.3 Not tainted 5.15.142-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
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+0x248/0x2b0 kernel/locking/lockdep.c:5065
__lock_release kernel/locking/lockdep.c:5302 [inline]
lock_release+0x596/0x9a0 kernel/locking/lockdep.c:5643
up_write+0x75/0x4d0 kernel/locking/rwsem.c:1593
swap_inode_boot_loader fs/ext4/ioctl.c:262 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
ext4_ioctl+0x285a/0x5b80 fs/ext4/ioctl.c:1276
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f47f566cba9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f47f3bee0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f47f578bf80 RCX: 00007f47f566cba9
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007f47f56b847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f47f578bf80 R15: 00007fff2f8a5768
</TASK>
------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff888070dde730, owner = 0x0, curr 0xffff888097275940, list empty
WARNING: CPU: 1 PID: 4174 at kernel/locking/rwsem.c:1342 __up_write kernel/locking/rwsem.c:1341 [inline]
WARNING: CPU: 1 PID: 4174 at kernel/locking/rwsem.c:1342 up_write+0x473/0x4d0 kernel/locking/rwsem.c:1594
Modules linked in:
CPU: 1 PID: 4174 Comm: syz-executor.3 Not tainted 5.15.142-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:__up_write kernel/locking/rwsem.c:1341 [inline]
RIP: 0010:up_write+0x473/0x4d0 kernel/locking/rwsem.c:1594
Code: 48 c7 c7 e0 00 8b 8a 48 c7 c6 a0 03 8b 8a 48 8b 54 24 28 48 8b 4c 24 18 4d 89 e0 4c 8b 4c 24 30 53 e8 d1 11 ea ff 48 83 c4 08 <0f> 0b e9 86 fd ff ff 48 c7 c1 48 ca e3 8d 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc90004cf7940 EFLAGS: 00010292
RAX: 5407833763e85900 RBX: ffffffff8a8b01c0 RCX: 0000000000040000
RDX: ffffc90003b6e000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90004cf7a10 R08: ffffffff81665bbc R09: ffffed10173667a8
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffff888070dde730 R14: 1ffff9200099ef30 R15: dffffc0000000000
FS: 00007f47f3bee6c0(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7a83f71038 CR3: 000000007c435000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
swap_inode_boot_loader fs/ext4/ioctl.c:262 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
ext4_ioctl+0x285a/0x5b80 fs/ext4/ioctl.c:1276
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f47f566cba9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f47f3bee0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f47f578bf80 RCX: 00007f47f566cba9
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007f47f56b847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f47f578bf80 R15: 00007fff2f8a5768
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Dec 11, 2023, 3:10:28 PM12/11/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e7cddbb41b63 Linux 6.1.67
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=177fc242e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=8160fc00d26f042b
dashboard link: https://syzkaller.appspot.com/bug?extid=412cf01ec1834ce6d161
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8956c6179c51/disk-e7cddbb4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d5ebbb26ed14/vmlinux-e7cddbb4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/30e370b152f6/bzImage-e7cddbb4.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+412cf0...@syzkaller.appspotmail.com

EXT4-fs (loop2): 1 truncate cleaned up
EXT4-fs (loop2): mounted filesystem without journal. Quota mode: none.
=====================================
WARNING: bad unlock balance detected!
6.1.67-syzkaller #0 Not tainted
-------------------------------------
syz-executor.2/7347 is trying to release lock (&type->i_mutex_dir_key) at:
[<ffffffff823bfb39>] swap_inode_boot_loader fs/ext4/ioctl.c:513 [inline]
[<ffffffff823bfb39>] __ext4_ioctl fs/ext4/ioctl.c:1424 [inline]
[<ffffffff823bfb39>] ext4_ioctl+0x4249/0x5f60 fs/ext4/ioctl.c:1614
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor.2/7347:
#0: ffff888084bde460 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write_file+0x5a/0x1f0 fs/namespace.c:437

stack backtrace:
CPU: 1 PID: 7347 Comm: syz-executor.2 Not tainted 6.1.67-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
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
up_write+0x75/0x580 kernel/locking/rwsem.c:1625
swap_inode_boot_loader fs/ext4/ioctl.c:513 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1424 [inline]
ext4_ioctl+0x4249/0x5f60 fs/ext4/ioctl.c:1614
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f2205a7cba9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f220683b0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f2205b9bf80 RCX: 00007f2205a7cba9
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007f2205ac847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f2205b9bf80 R15: 00007fffa1bfd5b8
</TASK>
------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff8880876f49c8, owner = 0x0, curr 0xffff8880840dd940, list empty
WARNING: CPU: 1 PID: 7347 at kernel/locking/rwsem.c:1372 __up_write kernel/locking/rwsem.c:1371 [inline]
WARNING: CPU: 1 PID: 7347 at kernel/locking/rwsem.c:1372 up_write+0x4f5/0x580 kernel/locking/rwsem.c:1626
Modules linked in:
CPU: 1 PID: 7347 Comm: syz-executor.2 Not tainted 6.1.67-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:__up_write kernel/locking/rwsem.c:1371 [inline]
RIP: 0010:up_write+0x4f5/0x580 kernel/locking/rwsem.c:1626
Code: 48 c7 c7 40 d8 eb 8a 48 c7 c6 80 da eb 8a 48 8b 54 24 28 48 8b 4c 24 18 4d 89 e0 4c 8b 4c 24 30 53 e8 df dc e8 ff 48 83 c4 08 <0f> 0b e9 71 fd ff ff 48 c7 c1 a8 73 73 8e 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc90014d8f840 EFLAGS: 00010292
RAX: 134a6f17fb7bf800 RBX: ffffffff8aebd920 RCX: 0000000000040000
RDX: ffffc9000b1e9000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90014d8f910 R08: ffffffff81527dae R09: fffff520029b1e69
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffff8880876f49c8 R14: 1ffff920029b1f10 R15: dffffc0000000000
FS: 00007f220683b6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f95d94c66e4 CR3: 0000000078864000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
swap_inode_boot_loader fs/ext4/ioctl.c:513 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1424 [inline]
ext4_ioctl+0x4249/0x5f60 fs/ext4/ioctl.c:1614
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f2205a7cba9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f220683b0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f2205b9bf80 RCX: 00007f2205a7cba9
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007f2205ac847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f2205b9bf80 R15: 00007fffa1bfd5b8

syzbot

unread,
Dec 11, 2023, 5:11:22 PM12/11/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: e7cddbb41b63 Linux 6.1.67
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=100826fae80000
kernel config: https://syzkaller.appspot.com/x/.config?x=8160fc00d26f042b
dashboard link: https://syzkaller.appspot.com/bug?extid=412cf01ec1834ce6d161
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16cae88ee80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=136ce596e80000
mounted in repro: https://storage.googleapis.com/syzbot-assets/098bf93c1d8c/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+412cf0...@syzkaller.appspotmail.com

EXT4-fs: Ignoring removed bh option
EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem
EXT4-fs (loop0): 1 truncate cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none.
=====================================
WARNING: bad unlock balance detected!
6.1.67-syzkaller #0 Not tainted
-------------------------------------
syz-executor311/3545 is trying to release lock (&type->i_mutex_dir_key) at:
[<ffffffff823bfb39>] swap_inode_boot_loader fs/ext4/ioctl.c:513 [inline]
[<ffffffff823bfb39>] __ext4_ioctl fs/ext4/ioctl.c:1424 [inline]
[<ffffffff823bfb39>] ext4_ioctl+0x4249/0x5f60 fs/ext4/ioctl.c:1614
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor311/3545:
#0: ffff888072c0e460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write_file+0x5a/0x1f0 fs/namespace.c:437

stack backtrace:
CPU: 1 PID: 3545 Comm: syz-executor311 Not tainted 6.1.67-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
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
up_write+0x75/0x580 kernel/locking/rwsem.c:1625
swap_inode_boot_loader fs/ext4/ioctl.c:513 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1424 [inline]
ext4_ioctl+0x4249/0x5f60 fs/ext4/ioctl.c:1614
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fe743eb9b39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffe6aa4deb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffe6aa4e098 RCX: 00007fe743eb9b39
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007fe743f2d610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe6aa4e088 R14: 0000000000000001 R15: 0000000000000001
</TASK>
------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff88806fcd8d98, owner = 0x0, curr 0xffff88807d2cd940, list empty
WARNING: CPU: 1 PID: 3545 at kernel/locking/rwsem.c:1372 __up_write kernel/locking/rwsem.c:1371 [inline]
WARNING: CPU: 1 PID: 3545 at kernel/locking/rwsem.c:1372 up_write+0x4f5/0x580 kernel/locking/rwsem.c:1626
Modules linked in:
CPU: 1 PID: 3545 Comm: syz-executor311 Not tainted 6.1.67-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:__up_write kernel/locking/rwsem.c:1371 [inline]
RIP: 0010:up_write+0x4f5/0x580 kernel/locking/rwsem.c:1626
Code: 48 c7 c7 40 d8 eb 8a 48 c7 c6 80 da eb 8a 48 8b 54 24 28 48 8b 4c 24 18 4d 89 e0 4c 8b 4c 24 30 53 e8 df dc e8 ff 48 83 c4 08 <0f> 0b e9 71 fd ff ff 48 c7 c1 a8 73 73 8e 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc90003adf840 EFLAGS: 00010292
RAX: dfabf9f051e99f00 RBX: ffffffff8aebd920 RCX: ffff88807d2cd940
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003adf910 R08: ffffffff81527dae R09: fffff5200075be69
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffff88806fcd8d98 R14: 1ffff9200075bf10 R15: dffffc0000000000
FS: 0000555555e2a380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000007d4ce000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
swap_inode_boot_loader fs/ext4/ioctl.c:513 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1424 [inline]
ext4_ioctl+0x4249/0x5f60 fs/ext4/ioctl.c:1614
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fe743eb9b39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffe6aa4deb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffe6aa4e098 RCX: 00007fe743eb9b39
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007fe743f2d610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe6aa4e088 R14: 0000000000000001 R15: 0000000000000001
</TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Feb 28, 2024, 3:12:28 PMFeb 28
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 458ce51d0356 Linux 5.15.149
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12a1bc6a180000
kernel config: https://syzkaller.appspot.com/x/.config?x=8c016b4e71f1c777
dashboard link: https://syzkaller.appspot.com/bug?extid=77a0245eb4ed995150a6
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11040412180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17e87b8c180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c84f9ea3bbab/disk-458ce51d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/70bdbf46c57d/vmlinux-458ce51d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/73fc8d1364f3/bzImage-458ce51d.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/43a5335bb6bd/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+77a024...@syzkaller.appspotmail.com

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!
5.15.149-syzkaller #0 Not tainted
-------------------------------------
syz-executor233/3507 is trying to release lock (&type->i_mutex_dir_key) at:
[<ffffffff821e2eca>] swap_inode_boot_loader fs/ext4/ioctl.c:262 [inline]
[<ffffffff821e2eca>] __ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
[<ffffffff821e2eca>] ext4_ioctl+0x285a/0x5b80 fs/ext4/ioctl.c:1276
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor233/3507:
#0: ffff888077c4e460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write_file+0x5a/0x1f0 fs/namespace.c:421

stack backtrace:
CPU: 1 PID: 3507 Comm: syz-executor233 Not tainted 5.15.149-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/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+0x248/0x2b0 kernel/locking/lockdep.c:5065
__lock_release kernel/locking/lockdep.c:5302 [inline]
lock_release+0x596/0x9a0 kernel/locking/lockdep.c:5643
up_write+0x75/0x4d0 kernel/locking/rwsem.c:1593
swap_inode_boot_loader fs/ext4/ioctl.c:262 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
ext4_ioctl+0x285a/0x5b80 fs/ext4/ioctl.c:1276
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f63b44dfb39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffc49d660c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffc49d662a8 RCX: 00007f63b44dfb39
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007f63b4553610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc49d66298 R14: 0000000000000001 R15: 0000000000000001
</TASK>
------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff8880742ca168, owner = 0x0, curr 0xffff88807da93b80, list empty
WARNING: CPU: 1 PID: 3507 at kernel/locking/rwsem.c:1342 __up_write kernel/locking/rwsem.c:1341 [inline]
WARNING: CPU: 1 PID: 3507 at kernel/locking/rwsem.c:1342 up_write+0x473/0x4d0 kernel/locking/rwsem.c:1594
Modules linked in:
CPU: 1 PID: 3507 Comm: syz-executor233 Not tainted 5.15.149-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:__up_write kernel/locking/rwsem.c:1341 [inline]
RIP: 0010:up_write+0x473/0x4d0 kernel/locking/rwsem.c:1594
Code: 48 c7 c7 80 08 8b 8a 48 c7 c6 40 0b 8b 8a 48 8b 54 24 28 48 8b 4c 24 18 4d 89 e0 4c 8b 4c 24 30 53 e8 41 11 ea ff 48 83 c4 08 <0f> 0b e9 86 fd ff ff 48 c7 c1 c8 ed e3 8d 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc90002ea7940 EFLAGS: 00010292
RAX: 3bf1e3736039c800 RBX: ffffffff8a8b0960 RCX: ffff88807da93b80
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90002ea7a10 R08: ffffffff8166625c R09: fffff520005d4e69
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffff8880742ca168 R14: 1ffff920005d4f30 R15: dffffc0000000000
FS: 0000555556d48380(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000078f65000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
swap_inode_boot_loader fs/ext4/ioctl.c:262 [inline]
__ext4_ioctl fs/ext4/ioctl.c:1056 [inline]
ext4_ioctl+0x285a/0x5b80 fs/ext4/ioctl.c:1276
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f63b44dfb39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffc49d660c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffc49d662a8 RCX: 00007f63b44dfb39
RDX: 0000000000000000 RSI: 0000000000006611 RDI: 0000000000000004
RBP: 00007f63b4553610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc49d66298 R14: 0000000000000001 R15: 0000000000000001
Reply all
Reply to author
Forward
0 new messages