syzbot


possible deadlock in freeze_super

Status: upstream: reported on 2025/07/17 15:42
Reported-by: syzbot+05de73f05796dceaf1b4@syzkaller.appspotmail.com
First crash: 2d01h, last: 2d01h
Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in freeze_super (2) gfs2 4 C error done 15 797d 1013d 22/29 fixed on 2023/06/08 14:41
linux-5.15 possible deadlock in freeze_super 4 1 343d 343d 0/3 auto-obsoleted due to no activity on 2024/11/18 15:18
upstream possible deadlock in freeze_super (3) ext4 4 9 6d16h 79d 0/29 upstream: reported on 2025/04/30 22:14
upstream possible deadlock in freeze_super gfs2 4 938 1568d 1699d 0/29 auto-closed as invalid on 2021/07/02 04:50
linux-5.15 possible deadlock in freeze_super (2) origin:lts-only 4 C error 11 14d 226d 0/3 upstream: reported C repro on 2024/12/05 16:25

Sample crash report:
loop2: detected capacity change from 0 to 2048
EXT4-fs (loop2): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
EXT4-fs (loop2): shut down requested (0)
======================================================
WARNING: possible circular locking dependency detected
6.6.98-syzkaller #0 Not tainted
------------------------------------------------------
syz.2.1287/9584 is trying to acquire lock:
ffff88807f3b8608 (sb_internal){++++}-{0:0}, at: sb_wait_write fs/super.c:1860 [inline]
ffff88807f3b8608 (sb_internal){++++}-{0:0}, at: freeze_super+0x659/0x970 fs/super.c:2027

but task is already holding lock:
ffff88807f3b8510 (sb_pagefaults){++++}-{0:0}, at: sb_wait_write fs/super.c:1860 [inline]
ffff88807f3b8510 (sb_pagefaults){++++}-{0:0}, at: freeze_super+0x5c3/0x970 fs/super.c:2013

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (sb_pagefaults){++++}-{0:0}:
       percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51
       __sb_start_write include/linux/fs.h:1633 [inline]
       sb_start_pagefault include/linux/fs.h:1737 [inline]
       ext4_page_mkwrite+0x1dc/0x1210 fs/ext4/inode.c:6223
       do_page_mkwrite+0x153/0x3e0 mm/memory.c:2950
       wp_page_shared mm/memory.c:3310 [inline]
       do_wp_page+0xe5e/0x3630 mm/memory.c:3395
       handle_pte_fault mm/memory.c:5041 [inline]
       __handle_mm_fault mm/memory.c:5166 [inline]
       handle_mm_fault+0x12d4/0x4920 mm/memory.c:5331
       do_user_addr_fault+0x738/0x12e0 arch/x86/mm/fault.c:1373
       handle_page_fault arch/x86/mm/fault.c:1465 [inline]
       exc_page_fault+0x67/0x110 arch/x86/mm/fault.c:1521
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:608

-> #3 (&mm->mmap_lock){++++}-{3:3}:
       __might_fault+0xc6/0x120 mm/memory.c:5946
       _copy_to_user+0x2a/0xa0 lib/usercopy.c:36
       copy_to_user include/linux/uaccess.h:191 [inline]
       fiemap_fill_next_extent+0x1c1/0x390 fs/ioctl.c:145
       ocfs2_fiemap+0x882/0xc80 fs/ocfs2/extent_map.c:796
       ioctl_fiemap fs/ioctl.c:220 [inline]
       do_vfs_ioctl+0x140c/0x1bb0 fs/ioctl.c:811
       __do_sys_ioctl fs/ioctl.c:869 [inline]
       __se_sys_ioctl+0x83/0x170 fs/ioctl.c:857
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #2 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
       down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
       ocfs2_create_local_dquot+0x1a4/0x1790 fs/ocfs2/quota_local.c:1224
       ocfs2_acquire_dquot+0x7cf/0xaf0 fs/ocfs2/quota_global.c:871
       dqget+0x77c/0xeb0 fs/quota/dquot.c:988
       __dquot_initialize+0x3ba/0xcb0 fs/quota/dquot.c:1516
       ocfs2_get_init_inode+0x13c/0x1b0 fs/ocfs2/namei.c:202
       ocfs2_symlink+0xb84/0x2550 fs/ocfs2/namei.c:1878
       vfs_symlink+0x138/0x2b0 fs/namei.c:4473
       do_symlinkat+0x1b2/0x3f0 fs/namei.c:4499
       __do_sys_symlink fs/namei.c:4520 [inline]
       __se_sys_symlink fs/namei.c:4518 [inline]
       __x64_sys_symlink+0x7e/0x90 fs/namei.c:4518
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&dquot->dq_lock){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
       dquot_release+0x66/0x610 fs/quota/dquot.c:533
       ext4_release_dquot+0x3e7/0x6b0 fs/ext4/ext4_jbd2.h:-1
       quota_release_workfn+0x35a/0x600 fs/quota/dquot.c:848
       process_one_work kernel/workqueue.c:2634 [inline]
       process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
       worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
       kthread+0x2fa/0x390 kernel/kthread.c:388
       ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
       ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

-> #0 (sb_internal){++++}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
       lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
       percpu_down_write+0x54/0x2e0 kernel/locking/percpu-rwsem.c:227
       sb_wait_write fs/super.c:1860 [inline]
       freeze_super+0x659/0x970 fs/super.c:2027
       freeze_bdev+0xfd/0x230 block/bdev.c:236
       ext4_force_shutdown+0x312/0x530 fs/ext4/ioctl.c:822
       ext4_ioctl_shutdown fs/ext4/ioctl.c:857 [inline]
       __ext4_ioctl fs/ext4/ioctl.c:1588 [inline]
       ext4_ioctl+0x1e8f/0x3820 fs/ext4/ioctl.c:1627
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:871 [inline]
       __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  sb_internal --> &mm->mmap_lock --> sb_pagefaults

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_pagefaults);
                               lock(&mm->mmap_lock);
                               lock(sb_pagefaults);
  lock(sb_internal);

 *** DEADLOCK ***

4 locks held by syz.2.1287/9584:
 #0: ffff888148dad228 (&bdev->bd_fsfreeze_mutex){+.+.}-{3:3}, at: freeze_bdev+0x31/0x230 block/bdev.c:226
 #1: ffff88807f3b8418 (sb_writers#4){++++}-{0:0}, at: sb_wait_write fs/super.c:1860 [inline]
 #1: ffff88807f3b8418 (sb_writers#4){++++}-{0:0}, at: freeze_super+0x4c4/0x970 fs/super.c:2007
 #2: ffff88807f3b80e0 (&type->s_umount_key#31){++++}-{3:3}, at: __super_lock fs/super.c:56 [inline]
 #2: ffff88807f3b80e0 (&type->s_umount_key#31){++++}-{3:3}, at: super_lock+0x11a/0x360 fs/super.c:117
 #3: ffff88807f3b8510 (sb_pagefaults){++++}-{0:0}, at: sb_wait_write fs/super.c:1860 [inline]
 #3: ffff88807f3b8510 (sb_pagefaults){++++}-{0:0}, at: freeze_super+0x5c3/0x970 fs/super.c:2013

stack backtrace:
CPU: 0 PID: 9584 Comm: syz.2.1287 Not tainted 6.6.98-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 check_noncircular+0x2bd/0x3c0 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
 percpu_down_write+0x54/0x2e0 kernel/locking/percpu-rwsem.c:227
 sb_wait_write fs/super.c:1860 [inline]
 freeze_super+0x659/0x970 fs/super.c:2027
 freeze_bdev+0xfd/0x230 block/bdev.c:236
 ext4_force_shutdown+0x312/0x530 fs/ext4/ioctl.c:822
 ext4_ioctl_shutdown fs/ext4/ioctl.c:857 [inline]
 __ext4_ioctl fs/ext4/ioctl.c:1588 [inline]
 ext4_ioctl+0x1e8f/0x3820 fs/ext4/ioctl.c:1627
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f5003b8e929
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:00007f500491c038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f5003db5fa0 RCX: 00007f5003b8e929
RDX: 00002000000003c0 RSI: 000000008004587d RDI: 0000000000000004
RBP: 00007f5003c10ca1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f5003db5fa0 R15: 00007ffd41d1f2e8
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/17 15:41 linux-6.6.y 9247f4e6573a 0d1223f1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in freeze_super
* Struck through repros no longer work on HEAD.