syzbot


possible deadlock in vfs_link

Status: closed as dup on 2025/09/04 18:08
Subsystems: overlayfs bcachefs
[Documentation on labels]
Reported-by: syzbot+1090a418b58c19e9a57b@syzkaller.appspotmail.com
First crash: 2d20h, last: 2d16h
Duplicate of
Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported
WARNING in shmem_unlink overlayfs -1 syz inconclusive 7 10d 21d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [overlayfs?] [bcachefs?] possible deadlock in vfs_link 1 (2) 2025/09/04 18:08

Sample crash report:
bcachefs (loop0): resume_logged_ops... done
bcachefs (loop0): delete_dead_inodes... done
bcachefs (loop0): done starting filesystem
============================================
WARNING: possible recursive locking detected
6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 Not tainted
--------------------------------------------
syz.0.19/6755 is trying to acquire lock:
ffff0000ec7c5c68 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline]
ffff0000ec7c5c68 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: vfs_link+0x2f0/0x590 fs/namei.c:4845

but task is already holding lock:
ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline]
ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: ovl_create_temp fs/overlayfs/dir.c:228 [inline]
ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: ovl_create_over_whiteout fs/overlayfs/dir.c:473 [inline]
ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: ovl_create_or_link+0x608/0x11b8 fs/overlayfs/dir.c:629

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&sb->s_type->i_mutex_key#21);
  lock(&sb->s_type->i_mutex_key#21);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

6 locks held by syz.0.19/6755:
 #0: ffff0000dcc7e428 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:557
 #1: ffff0000ec7b1e50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline]
 #1: ffff0000ec7b1e50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: filename_create+0x1ac/0x32c fs/namei.c:4139
 #2: ffff0000ec7b2418 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline]
 #2: ffff0000ec7b2418 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: vfs_link+0x2f0/0x590 fs/namei.c:4845
 #3: ffff0000ec7b27d0 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:672 [inline]
 #3: ffff0000ec7b27d0 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_nlink_start+0x2fc/0x6e0 fs/overlayfs/util.c:1176
 #4: ffff0000d2034428 (sb_writers#11){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:557
 #5: ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline]
 #5: ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: ovl_create_temp fs/overlayfs/dir.c:228 [inline]
 #5: ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: ovl_create_over_whiteout fs/overlayfs/dir.c:473 [inline]
 #5: ffff0000ec7c54d0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: ovl_create_or_link+0x608/0x11b8 fs/overlayfs/dir.c:629

stack backtrace:
CPU: 0 UID: 0 PID: 6755 Comm: syz.0.19 Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Call trace:
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C)
 __dump_stack+0x30/0x40 lib/dump_stack.c:94
 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120
 dump_stack+0x1c/0x28 lib/dump_stack.c:129
 print_deadlock_bug+0x2e8/0x2f0 kernel/locking/lockdep.c:3041
 check_deadlock kernel/locking/lockdep.c:3093 [inline]
 validate_chain kernel/locking/lockdep.c:3895 [inline]
 __lock_acquire+0x2940/0x30a4 kernel/locking/lockdep.c:5237
 lock_acquire+0x14c/0x2e0 kernel/locking/lockdep.c:5868
 down_write+0x50/0xc0 kernel/locking/rwsem.c:1590
 inode_lock include/linux/fs.h:869 [inline]
 vfs_link+0x2f0/0x590 fs/namei.c:4845
 ovl_do_link fs/overlayfs/overlayfs.h:227 [inline]
 ovl_create_real+0x11c/0x3fc fs/overlayfs/dir.c:179
 ovl_create_temp fs/overlayfs/dir.c:229 [inline]
 ovl_create_over_whiteout fs/overlayfs/dir.c:473 [inline]
 ovl_create_or_link+0x62c/0x11b8 fs/overlayfs/dir.c:629
 ovl_link+0x1d8/0x258 fs/overlayfs/dir.c:746
 vfs_link+0x3e0/0x590 fs/namei.c:4854
 do_linkat+0x224/0x48c fs/namei.c:4924
 __do_sys_linkat fs/namei.c:4952 [inline]
 __se_sys_linkat fs/namei.c:4949 [inline]
 __arm64_sys_linkat+0xdc/0xf8 fs/namei.c:4949
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879
 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/04 00:15 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f5ae30d69d7 96a211bc .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 possible deadlock in vfs_link
2025/09/03 23:30 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f5ae30d69d7 96a211bc .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 possible deadlock in vfs_link
2025/09/03 22:46 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f5ae30d69d7 96a211bc .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 possible deadlock in vfs_link
2025/09/03 21:49 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f5ae30d69d7 96a211bc .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 possible deadlock in vfs_link
2025/09/03 20:50 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f5ae30d69d7 96a211bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in vfs_link
* Struck through repros no longer work on HEAD.