syzbot


possible deadlock in lookup_slow (3)

Status: upstream: reported on 2023/07/19 13:17
Subsystems: kernfs
[Documentation on labels]
Reported-by: syzbot+65459fd3b61877d717a3@syzkaller.appspotmail.com
First crash: 494d, last: 13d
Discussions (9)
Title Replies (including bot) Last reply
[syzbot] Monthly kernfs report (Nov 2024) 0 (1) 2024/11/15 11:25
[syzbot] Monthly kernfs report (Jul 2024) 0 (1) 2024/07/09 14:10
[syzbot] Monthly kernfs report (May 2024) 0 (1) 2024/05/08 08:25
[syzbot] Monthly kernfs report (Apr 2024) 0 (1) 2024/04/08 08:30
[syzbot] Monthly kernfs report (Jan 2024) 0 (1) 2024/01/02 13:36
[syzbot] Monthly kernfs report (Nov 2023) 0 (1) 2023/11/29 13:03
[syzbot] Monthly kernfs report (Oct 2023) 0 (1) 2023/10/30 09:14
[syzbot] Monthly kernfs report (Sep 2023) 0 (1) 2023/09/28 14:01
[syzbot] [kernfs?] possible deadlock in lookup_slow (3) 0 (1) 2023/07/19 13:17
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in lookup_slow 11 445d 617d 0/3 auto-obsoleted due to no activity on 2023/12/11 13:10
linux-4.19 possible deadlock in lookup_slow 22 1620d 2046d 0/1 auto-closed as invalid on 2020/10/12 22:59
upstream possible deadlock in lookup_slow fs 139 2006d 2247d 0/28 auto-closed as invalid on 2019/10/25 08:42
linux-5.15 possible deadlock in lookup_slow (2) origin:upstream C 61 2d11h 343d 0/3 upstream: reported C repro on 2023/12/13 22:35
linux-4.14 possible deadlock in lookup_slow C 2027 625d 1916d 0/1 upstream: reported C repro on 2019/08/24 01:53
upstream possible deadlock in lookup_slow (2) fs 7 1774d 1819d 0/28 auto-closed as invalid on 2020/05/11 09:17

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.12.0-rc6-syzkaller-00169-g906bd684e4b1 #0 Not tainted
------------------------------------------------------
syz.6.5545/20032 is trying to acquire lock:
ffff8880579cd258 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:825 [inline]
ffff8880579cd258 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: lookup_slow+0x45/0x70 fs/namei.c:1748

but task is already holding lock:
ffff8880331fe888 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1ea/0x500 fs/kernfs/file.c:325

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&of->mutex){+.+.}-{3:3}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       __mutex_lock_common kernel/locking/mutex.c:608 [inline]
       __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
       kernfs_fop_write_iter+0x1ea/0x500 fs/kernfs/file.c:325
       iter_file_splice_write+0xbfa/0x1510 fs/splice.c:743
       do_splice_from fs/splice.c:941 [inline]
       do_splice+0xd68/0x18e0 fs/splice.c:1354
       __do_splice fs/splice.c:1436 [inline]
       __do_sys_splice fs/splice.c:1652 [inline]
       __se_sys_splice+0x331/0x4a0 fs/splice.c:1634
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #2 (&pipe->mutex){+.+.}-{3:3}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       __mutex_lock_common kernel/locking/mutex.c:608 [inline]
       __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
       iter_file_splice_write+0x330/0x1510 fs/splice.c:687
       do_splice_from fs/splice.c:941 [inline]
       do_splice+0xd68/0x18e0 fs/splice.c:1354
       __do_splice fs/splice.c:1436 [inline]
       __do_sys_splice fs/splice.c:1652 [inline]
       __se_sys_splice+0x331/0x4a0 fs/splice.c:1634
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (sb_writers#5){.+.+}-{0:0}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1716 [inline]
       sb_start_write+0x4d/0x1c0 include/linux/fs.h:1852
       mnt_want_write+0x3f/0x90 fs/namespace.c:515
       ovl_xattr_set+0x14e/0x520 fs/overlayfs/xattrs.c:63
       ovl_own_xattr_set+0x173/0x1c0 fs/overlayfs/xattrs.c:213
       __vfs_setxattr+0x468/0x4a0 fs/xattr.c:200
       __vfs_setxattr_noperm+0x12e/0x660 fs/xattr.c:234
       vfs_setxattr+0x221/0x430 fs/xattr.c:321
       do_setxattr fs/xattr.c:629 [inline]
       path_setxattr+0x37e/0x4d0 fs/xattr.c:658
       __do_sys_lsetxattr fs/xattr.c:683 [inline]
       __se_sys_lsetxattr fs/xattr.c:679 [inline]
       __x64_sys_lsetxattr+0xb8/0xd0 fs/xattr.c:679
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3161 [inline]
       check_prevs_add kernel/locking/lockdep.c:3280 [inline]
       validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
       __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524
       inode_lock_shared include/linux/fs.h:825 [inline]
       lookup_slow+0x45/0x70 fs/namei.c:1748
       walk_component+0x2e1/0x410 fs/namei.c:2053
       lookup_last fs/namei.c:2556 [inline]
       path_lookupat+0x16f/0x450 fs/namei.c:2580
       filename_lookup+0x256/0x610 fs/namei.c:2609
       kern_path+0x35/0x50 fs/namei.c:2717
       lookup_bdev+0xc5/0x290 block/bdev.c:1164
       resume_store+0x1a0/0x710 kernel/power/hibernate.c:1239
       kernfs_fop_write_iter+0x3a0/0x500 fs/kernfs/file.c:334
       new_sync_write fs/read_write.c:590 [inline]
       vfs_write+0xaeb/0xd30 fs/read_write.c:683
       ksys_write+0x183/0x2b0 fs/read_write.c:736
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

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

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

4 locks held by syz.6.5545/20032:
 #0: ffff8880307d37b8 (&f->f_pos_lock){+.+.}-{3:3}, at: fdget_pos+0x24e/0x320 fs/file.c:1160
 #1: ffff8880302ce420 (sb_writers#8){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2931 [inline]
 #1: ffff8880302ce420 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x225/0xd30 fs/read_write.c:679
 #2: ffff8880331fe888 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1ea/0x500 fs/kernfs/file.c:325
 #3: ffff888140ed1b48 (kn->active#58){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x20e/0x500 fs/kernfs/file.c:326

stack backtrace:
CPU: 0 UID: 0 PID: 20032 Comm: syz.6.5545 Not tainted 6.12.0-rc6-syzkaller-00169-g906bd684e4b1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206
 check_prev_add kernel/locking/lockdep.c:3161 [inline]
 check_prevs_add kernel/locking/lockdep.c:3280 [inline]
 validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524
 inode_lock_shared include/linux/fs.h:825 [inline]
 lookup_slow+0x45/0x70 fs/namei.c:1748
 walk_component+0x2e1/0x410 fs/namei.c:2053
 lookup_last fs/namei.c:2556 [inline]
 path_lookupat+0x16f/0x450 fs/namei.c:2580
 filename_lookup+0x256/0x610 fs/namei.c:2609
 kern_path+0x35/0x50 fs/namei.c:2717
 lookup_bdev+0xc5/0x290 block/bdev.c:1164
 resume_store+0x1a0/0x710 kernel/power/hibernate.c:1239
 kernfs_fop_write_iter+0x3a0/0x500 fs/kernfs/file.c:334
 new_sync_write fs/read_write.c:590 [inline]
 vfs_write+0xaeb/0xd30 fs/read_write.c:683
 ksys_write+0x183/0x2b0 fs/read_write.c:736
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb6e2b7e719
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:00007fb6e3901038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fb6e2d35f80 RCX: 00007fb6e2b7e719
RDX: 0000000000000012 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 00007fb6e2bf139e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fb6e2d35f80 R15: 00007ffcb179eaf8
 </TASK>
block device autoloading is deprecated and will be removed.
syz.6.5545: attempt to access beyond end of device
md0: rw=2048, sector=0, nr_sectors = 8 limit=0
PM: Image not found (code -5)

Crashes (335):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/08 04:48 upstream 906bd684e4b1 c069283c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/07 14:24 upstream ff7afaeca1a1 c069283c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/06 21:43 upstream 7758b206117d df3dc63b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/04 02:39 upstream b9021de3ec2f f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/03 03:17 upstream 11066801dd4b f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/02 22:27 upstream 11066801dd4b f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/02 16:11 upstream 11066801dd4b f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/02 03:39 upstream 6c52d4da1c74 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/11/02 01:34 upstream 6c52d4da1c74 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in lookup_slow
2024/09/13 00:35 upstream fdf042df0463 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/09/06 14:27 upstream b831f83e40a2 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/09/02 05:40 upstream c9f016e72b5c 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/08/18 18:56 upstream c3f2d783a459 dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/07/18 00:45 upstream 51835949dda3 0f902625 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/29 08:06 upstream de0a9f448633 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/23 08:57 upstream 563a50672d8a edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/15 08:30 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/10 03:27 upstream 83a7eefedc9b 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/10 02:04 upstream 771ed66105de 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/09 01:18 upstream 061d1af7b030 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/08 05:54 upstream 96e09b8f8166 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/06 18:38 upstream d30d0e49da71 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/04 23:12 upstream 2ab795141095 11f2afa5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/03 09:39 upstream c3f38fa61af7 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/03 05:22 upstream c3f38fa61af7 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/02 14:51 upstream 83814698cf48 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/02 00:55 upstream 89be4025b0db 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/02 00:55 upstream 89be4025b0db 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/06/01 11:47 upstream cc8ed4d0a848 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/31 22:27 upstream d8ec19857b09 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/31 20:11 upstream d8ec19857b09 0c378259 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/31 09:44 upstream 4a4be1ad3a6e 0c378259 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/28 19:47 upstream e0cce98fe279 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/28 17:32 upstream 2bfcfd584ff5 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/17 06:45 upstream 3c999d1ae3c7 c2e07261 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/17 02:37 upstream 3c999d1ae3c7 c2e07261 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/17 00:42 upstream 3c999d1ae3c7 c2e07261 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/09 17:34 upstream 45db3ab70092 05079661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/08 03:54 upstream dccb07f2914c 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/05 07:41 upstream 7367539ad4b0 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/05/01 09:28 upstream 18daea77cca6 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/04/29 06:33 upstream e67572cd2204 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/04/15 11:38 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/04/15 08:49 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/04/15 07:33 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/04/15 05:24 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2024/04/15 00:25 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2023/07/19 08:57 upstream ccff6d117d8d 022df2bb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
2023/07/15 13:10 upstream b6e6cc1f78c7 35d9ecc5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in lookup_slow
* Struck through repros no longer work on HEAD.