[moderation] [fs?] possible deadlock in lookup_one_unlocked (2)

3 views
Skip to first unread message

syzbot

unread,
Jun 15, 2025, 8:37:26 PM6/15/25
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 488ef3560196 KEYS: Invert FINAL_PUT bit
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1437ad70580000
kernel config: https://syzkaller.appspot.com/x/.config?x=c4c8362784bb7796
dashboard link: https://syzkaller.appspot.com/bug?extid=63d952994431b5f1104f
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: i386
CC: [da...@kernel.org gre...@linuxfoundation.org linux-...@vger.kernel.org linux-...@vger.kernel.org raf...@kernel.org]

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

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-488ef356.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7f81727b6c23/vmlinux-488ef356.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0f71c5b3918b/bzImage-488ef356.xz

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

======================================================
WARNING: possible circular locking dependency detected
6.16.0-rc1-syzkaller-00005-g488ef3560196 #0 Not tainted
------------------------------------------------------
syz.3.4164/22783 is trying to acquire lock:
ffff88801273bb38 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:882 [inline]
ffff88801273bb38 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: lookup_slow fs/namei.c:1833 [inline]
ffff88801273bb38 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: lookup_one_unlocked fs/namei.c:3016 [inline]
ffff88801273bb38 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: lookup_one_unlocked+0xc7/0x120 fs/namei.c:3004

but task is already holding lock:
ffff88801273e3b0 (&ovl_i_mutex_dir_key[depth]#2){.+.+}-{4:4}, at: inode_lock_shared include/linux/fs.h:882 [inline]
ffff88801273e3b0 (&ovl_i_mutex_dir_key[depth]#2){.+.+}-{4:4}, at: lookup_slow fs/namei.c:1833 [inline]
ffff88801273e3b0 (&ovl_i_mutex_dir_key[depth]#2){.+.+}-{4:4}, at: walk_component+0x345/0x5b0 fs/namei.c:2138

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (&ovl_i_mutex_dir_key[depth]#2){.+.+}-{4:4}:
down_read+0x9b/0x480 kernel/locking/rwsem.c:1524
inode_lock_shared include/linux/fs.h:882 [inline]
lookup_slow fs/namei.c:1833 [inline]
walk_component+0x345/0x5b0 fs/namei.c:2138
lookup_last fs/namei.c:2639 [inline]
path_lookupat+0x142/0x6d0 fs/namei.c:2663
filename_lookup+0x224/0x5f0 fs/namei.c:2692
kern_path+0x35/0x50 fs/namei.c:2825
lookup_bdev+0xd8/0x280 block/bdev.c:1205
resume_store+0x1d6/0x460 kernel/power/hibernate.c:1272
kobj_attr_store+0x55/0x80 lib/kobject.c:840
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x351/0x510 fs/kernfs/file.c:334
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x6c4/0x1150 fs/read_write.c:686
ksys_write+0x12a/0x250 fs/read_write.c:738
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e

-> #3 (&of->mutex){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:602 [inline]
__mutex_lock+0x199/0xb90 kernel/locking/mutex.c:747
kernfs_fop_write_iter+0x28f/0x510 fs/kernfs/file.c:325
iter_file_splice_write+0x91c/0x1150 fs/splice.c:738
do_splice_from fs/splice.c:935 [inline]
do_splice+0x1475/0x1fc0 fs/splice.c:1348
__do_splice+0x32a/0x360 fs/splice.c:1430
__do_sys_splice fs/splice.c:1633 [inline]
__se_sys_splice fs/splice.c:1615 [inline]
__ia32_sys_splice+0x189/0x250 fs/splice.c:1615
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e

-> #2 (&pipe->mutex){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:602 [inline]
__mutex_lock+0x199/0xb90 kernel/locking/mutex.c:747
pipe_lock fs/pipe.c:91 [inline]
pipe_lock+0x64/0x80 fs/pipe.c:88
iter_file_splice_write+0x1ea/0x1150 fs/splice.c:683
do_splice_from fs/splice.c:935 [inline]
do_splice+0x1475/0x1fc0 fs/splice.c:1348
__do_splice+0x32a/0x360 fs/splice.c:1430
__do_sys_splice fs/splice.c:1633 [inline]
__se_sys_splice fs/splice.c:1615 [inline]
__ia32_sys_splice+0x189/0x250 fs/splice.c:1615
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e

-> #1 (sb_writers#5){.+.+}-{0:0}:
percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline]
percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline]
__sb_start_write include/linux/fs.h:1793 [inline]
sb_start_write include/linux/fs.h:1929 [inline]
mnt_want_write+0x6f/0x450 fs/namespace.c:557
ovl_create_object+0x12c/0x300 fs/overlayfs/dir.c:628
lookup_open.isra.0+0x11d0/0x1580 fs/namei.c:3708
open_last_lookups fs/namei.c:3807 [inline]
path_openat+0x893/0x2cb0 fs/namei.c:4043
do_filp_open+0x20b/0x470 fs/namei.c:4073
do_sys_openat2+0x11b/0x1d0 fs/open.c:1437
do_sys_open fs/open.c:1452 [inline]
__do_compat_sys_open fs/open.c:1505 [inline]
__se_compat_sys_open fs/open.c:1503 [inline]
__ia32_compat_sys_open+0x146/0x1e0 fs/open.c:1503
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e

-> #0 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3168 [inline]
check_prevs_add kernel/locking/lockdep.c:3287 [inline]
validate_chain kernel/locking/lockdep.c:3911 [inline]
__lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240
lock_acquire kernel/locking/lockdep.c:5871 [inline]
lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828
down_read+0x9b/0x480 kernel/locking/rwsem.c:1524
inode_lock_shared include/linux/fs.h:882 [inline]
lookup_slow fs/namei.c:1833 [inline]
lookup_one_unlocked fs/namei.c:3016 [inline]
lookup_one_unlocked+0xc7/0x120 fs/namei.c:3004
ovl_lookup_positive_unlocked fs/overlayfs/namei.c:210 [inline]
ovl_lookup_single+0x214/0xfc0 fs/overlayfs/namei.c:240
ovl_lookup_layer+0x3d4/0x480 fs/overlayfs/namei.c:333
ovl_lookup+0x13f9/0x21a0 fs/overlayfs/namei.c:1156
__lookup_slow+0x251/0x460 fs/namei.c:1817
lookup_slow fs/namei.c:1834 [inline]
walk_component+0x353/0x5b0 fs/namei.c:2138
lookup_last fs/namei.c:2639 [inline]
path_lookupat+0x142/0x6d0 fs/namei.c:2663
filename_lookup+0x224/0x5f0 fs/namei.c:2692
kern_path+0x35/0x50 fs/namei.c:2825
lookup_bdev+0xd8/0x280 block/bdev.c:1205
resume_store+0x1d6/0x460 kernel/power/hibernate.c:1272
kobj_attr_store+0x55/0x80 lib/kobject.c:840
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x351/0x510 fs/kernfs/file.c:334
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x6c4/0x1150 fs/read_write.c:686
ksys_write+0x12a/0x250 fs/read_write.c:738
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e

other info that might help us debug this:

Chain exists of:
&ovl_i_mutex_dir_key[depth] --> &of->mutex --> &ovl_i_mutex_dir_key[depth]#2

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
rlock(&ovl_i_mutex_dir_key[depth]#2);
lock(&of->mutex);
lock(&ovl_i_mutex_dir_key[depth]#2);
rlock(&ovl_i_mutex_dir_key[depth]);

*** DEADLOCK ***

5 locks held by syz.3.4164/22783:
#0: ffff888051c28478 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2a2/0x370 fs/file.c:1213
#1: ffff888024514428 (sb_writers#7){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:738
#2: ffff8880276a4888 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x28f/0x510 fs/kernfs/file.c:325
#3: ffff88801c3f3008 (kn->active#73){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2b2/0x510 fs/kernfs/file.c:326
#4: ffff88801273e3b0 (&ovl_i_mutex_dir_key[depth]#2){.+.+}-{4:4}, at: inode_lock_shared include/linux/fs.h:882 [inline]
#4: ffff88801273e3b0 (&ovl_i_mutex_dir_key[depth]#2){.+.+}-{4:4}, at: lookup_slow fs/namei.c:1833 [inline]
#4: ffff88801273e3b0 (&ovl_i_mutex_dir_key[depth]#2){.+.+}-{4:4}, at: walk_component+0x345/0x5b0 fs/namei.c:2138

stack backtrace:
CPU: 1 UID: 0 PID: 22783 Comm: syz.3.4164 Not tainted 6.16.0-rc1-syzkaller-00005-g488ef3560196 #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2046
check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2178
check_prev_add kernel/locking/lockdep.c:3168 [inline]
check_prevs_add kernel/locking/lockdep.c:3287 [inline]
validate_chain kernel/locking/lockdep.c:3911 [inline]
__lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240
lock_acquire kernel/locking/lockdep.c:5871 [inline]
lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828
down_read+0x9b/0x480 kernel/locking/rwsem.c:1524
inode_lock_shared include/linux/fs.h:882 [inline]
lookup_slow fs/namei.c:1833 [inline]
lookup_one_unlocked fs/namei.c:3016 [inline]
lookup_one_unlocked+0xc7/0x120 fs/namei.c:3004
ovl_lookup_positive_unlocked fs/overlayfs/namei.c:210 [inline]
ovl_lookup_single+0x214/0xfc0 fs/overlayfs/namei.c:240
ovl_lookup_layer+0x3d4/0x480 fs/overlayfs/namei.c:333
ovl_lookup+0x13f9/0x21a0 fs/overlayfs/namei.c:1156
__lookup_slow+0x251/0x460 fs/namei.c:1817
lookup_slow fs/namei.c:1834 [inline]
walk_component+0x353/0x5b0 fs/namei.c:2138
lookup_last fs/namei.c:2639 [inline]
path_lookupat+0x142/0x6d0 fs/namei.c:2663
filename_lookup+0x224/0x5f0 fs/namei.c:2692
kern_path+0x35/0x50 fs/namei.c:2825
lookup_bdev+0xd8/0x280 block/bdev.c:1205
resume_store+0x1d6/0x460 kernel/power/hibernate.c:1272
kobj_attr_store+0x55/0x80 lib/kobject.c:840
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x351/0x510 fs/kernfs/file.c:334
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x6c4/0x1150 fs/read_write.c:686
ksys_write+0x12a/0x250 fs/read_write.c:738
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf706e579
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f503d55c EFLAGS: 00000296 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 0000000080000040
RDX: 0000000000000012 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>
PM: Image not found (code -22)
----------------
Code disassembly (best guess), 2 bytes skipped:
0: 10 06 adc %al,(%rsi)
2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi
6: 10 07 adc %al,(%rdi)
8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi
c: 10 08 adc %cl,(%rax)
e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi
1e: 00 51 52 add %dl,0x52(%rcx)
21: 55 push %rbp
22: 89 e5 mov %esp,%ebp
24: 0f 34 sysenter
26: cd 80 int $0x80
* 28: 5d pop %rbp <-- trapping instruction
29: 5a pop %rdx
2a: 59 pop %rcx
2b: c3 ret
2c: 90 nop
2d: 90 nop
2e: 90 nop
2f: 90 nop
30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi
37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi


---
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,
Sep 9, 2025, 8:29:22 PM9/9/25
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages