syzbot


possible deadlock in path_openat

Status: upstream: reported C repro on 2023/03/17 13:15
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+2c421a1aee9406682e5d@syzkaller.appspotmail.com
First crash: 350d, last: 48d
Fix bisection: failed (error log, bisect log)
  
Bug presence (3)
Date Name Commit Repro Result
2024/01/13 linux-5.15.y (ToT) 26c690eff0a5 C [report] possible deadlock in path_openat
2023/05/18 upstream (ToT) 4d6d4c7f541d C [report] possible deadlock in path_openat
2024/01/13 upstream (ToT) 052d534373b7 C Didn't crash
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in path_openat fs C done unreliable 349 1429d 1983d 0/26 auto-obsoleted due to no activity on 2022/09/16 21:43
android-49 possible deadlock in path_openat 5 1558d 1573d 0/3 auto-closed as invalid on 2020/03/24 08:43
linux-6.1 possible deadlock in path_openat origin:upstream C 109 8d22h 354d 0/3 upstream: reported C repro on 2023/03/13 16:18
upstream possible deadlock in path_openat (2) reiserfs C error 305 31d 507d 0/26 upstream: reported C repro on 2022/10/11 06:35
linux-4.14 possible deadlock in path_openat reiserfs C error 327 365d 1773d 0/1 upstream: reported C repro on 2019/04/24 01:40
linux-4.19 possible deadlock in path_openat C error 859 360d 1721d 0/1 upstream: reported C repro on 2019/06/15 07:08
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2024/01/23 20:47 0m fix candidate upstream error job log (0)
2023/12/25 12:17 12m bisect fix linux-5.15.y error job log (0)

Sample crash report:
REISERFS (device loop3): Created .reiserfs_priv - reserved for xattr storage.
======================================================
WARNING: possible circular locking dependency detected
5.15.135-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor327/4010 is trying to acquire lock:
ffff0000df125fa0 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
ffff0000df125fa0 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3459 [inline]
ffff0000df125fa0 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: path_openat+0x63c/0x26f0 fs/namei.c:3669

but task is already holding lock:
ffff0000c1c0c460 (sb_writers#8){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (sb_writers#8){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1742 [inline]
       sb_start_write+0xf0/0x3ac include/linux/fs.h:1812
       mnt_want_write_file+0x64/0x1e8 fs/namespace.c:421
       reiserfs_ioctl+0x188/0x4b8 fs/reiserfs/ioctl.c:103
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl fs/ioctl.c:860 [inline]
       __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #1 (&sbi->lock){+.+.}-{3:3}:
       __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
       reiserfs_write_lock+0x7c/0xe8 fs/reiserfs/lock.c:27
       reiserfs_lookup+0x130/0x3c4 fs/reiserfs/namei.c:364
       __lookup_slow+0x250/0x388 fs/namei.c:1659
       lookup_one_len+0x178/0x28c fs/namei.c:2688
       reiserfs_lookup_privroot+0x8c/0x204 fs/reiserfs/xattr.c:980
       reiserfs_fill_super+0x1aec/0x1e8c fs/reiserfs/super.c:2178
       mount_bdev+0x274/0x370 fs/super.c:1387
       get_super_block+0x44/0x58 fs/reiserfs/super.c:2608
       legacy_get_tree+0xd4/0x16c fs/fs_context.c:611
       vfs_get_tree+0x90/0x274 fs/super.c:1517
       do_new_mount+0x25c/0x8c4 fs/namespace.c:2994
       path_mount+0x594/0x101c fs/namespace.c:3324
       do_mount fs/namespace.c:3337 [inline]
       __do_sys_mount fs/namespace.c:3545 [inline]
       __se_sys_mount fs/namespace.c:3522 [inline]
       __arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #0 (&type->i_mutex_dir_key#6){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3787 [inline]
       __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
       lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
       down_write+0x110/0x260 kernel/locking/rwsem.c:1541
       inode_lock include/linux/fs.h:787 [inline]
       open_last_lookups fs/namei.c:3459 [inline]
       path_openat+0x63c/0x26f0 fs/namei.c:3669
       do_filp_open+0x1a8/0x3b4 fs/namei.c:3699
       do_sys_openat2+0x128/0x3d8 fs/open.c:1211
       do_sys_open fs/open.c:1227 [inline]
       __do_sys_openat fs/open.c:1243 [inline]
       __se_sys_openat fs/open.c:1238 [inline]
       __arm64_sys_openat+0x1f0/0x240 fs/open.c:1238
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

other info that might help us debug this:

Chain exists of:
  &type->i_mutex_dir_key#6 --> &sbi->lock --> sb_writers#8

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_writers#8);
                               lock(&sbi->lock);
                               lock(sb_writers#8);
  lock(&type->i_mutex_dir_key#6);

 *** DEADLOCK ***

1 lock held by syz-executor327/4010:
 #0: ffff0000c1c0c460 (sb_writers#8){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377

stack backtrace:
CPU: 1 PID: 4010 Comm: syz-executor327 Not tainted 5.15.135-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011
 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3787 [inline]
 __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
 down_write+0x110/0x260 kernel/locking/rwsem.c:1541
 inode_lock include/linux/fs.h:787 [inline]
 open_last_lookups fs/namei.c:3459 [inline]
 path_openat+0x63c/0x26f0 fs/namei.c:3669
 do_filp_open+0x1a8/0x3b4 fs/namei.c:3699
 do_sys_openat2+0x128/0x3d8 fs/open.c:1211
 do_sys_open fs/open.c:1227 [inline]
 __do_sys_openat fs/open.c:1243 [inline]
 __se_sys_openat fs/open.c:1238 [inline]
 __arm64_sys_openat+0x1f0/0x240 fs/open.c:1238
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Crashes (117):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/17 03:33 linux-5.15.y 02e21884dcf2 342b9c55 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/05/16 13:22 linux-5.15.y b0ece631f84a 71b00cfb .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/06/12 13:06 linux-5.15.y 7349e40704a0 49519f06 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/11/20 19:51 linux-5.15.y 2a910f4af54d cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/11/09 15:27 linux-5.15.y 80529b4968a8 56230772 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/10/04 17:28 linux-5.15.y b911329317b4 b7d7ff54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/10/03 07:34 linux-5.15.y b911329317b4 65faba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/10/02 18:19 linux-5.15.y b911329317b4 50b20e75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2024/01/12 21:40 linux-5.15.y 26c690eff0a5 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2024/01/11 23:09 linux-5.15.y 26c690eff0a5 dda5a988 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/11/23 23:38 linux-5.15.y 2a910f4af54d 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/11/13 19:40 linux-5.15.y 80529b4968a8 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/11/09 20:44 linux-5.15.y 80529b4968a8 56230772 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/11/09 09:41 linux-5.15.y 80529b4968a8 4862372a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/11/08 21:37 linux-5.15.y 80529b4968a8 b93f63e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/31 13:24 linux-5.15.y 12952a23a5da 58499c95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/27 16:33 linux-5.15.y 12952a23a5da 3c418d72 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/27 03:50 linux-5.15.y 12952a23a5da bf285f0c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/24 23:56 linux-5.15.y 00c03985402e 17e6d526 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/19 13:51 linux-5.15.y 02e21884dcf2 42e1d524 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/17 01:54 linux-5.15.y 02e21884dcf2 342b9c55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/13 19:41 linux-5.15.y 02e21884dcf2 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/13 17:23 linux-5.15.y 02e21884dcf2 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/11 01:49 linux-5.15.y 02e21884dcf2 83165b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/09 16:26 linux-5.15.y 1edcec18cfb7 3c53c7d9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/10/06 14:09 linux-5.15.y 1edcec18cfb7 ea12a918 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/28 22:57 linux-5.15.y b911329317b4 d265efd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/28 08:37 linux-5.15.y b911329317b4 c2ab1e5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/28 03:51 linux-5.15.y b911329317b4 c2ab1e5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/23 15:48 linux-5.15.y b911329317b4 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/13 10:33 linux-5.15.y aff03380bda4 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/08 16:10 linux-5.15.y aff03380bda4 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/08 09:42 linux-5.15.y aff03380bda4 72324844 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/09/04 14:14 linux-5.15.y 8f790700c974 db3306a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/08/29 20:17 linux-5.15.y 5ddfe5cc8716 ce731e62 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/08/09 20:51 linux-5.15.y c275eaaaa342 13ca4cd6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/08/07 22:43 linux-5.15.y 38d4ca22a528 b1b6ae3d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/08/03 21:49 linux-5.15.y 38d4ca22a528 74621247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/07/24 13:31 linux-5.15.y cdd3cdb682f4 b03242d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/07/20 19:09 linux-5.15.y d54cfc420586 f49af159 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/07/11 06:09 linux-5.15.y d54cfc420586 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in path_openat
2023/08/25 09:52 linux-5.15.y f6f7927ac664 03d9c195 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/08/24 23:00 linux-5.15.y f6f7927ac664 49be837e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/08/09 19:05 linux-5.15.y c275eaaaa342 13ca4cd6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/08/09 07:20 linux-5.15.y c275eaaaa342 8ad1a287 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/08/05 16:19 linux-5.15.y 38d4ca22a528 4ffcc9ef .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/08/03 02:32 linux-5.15.y 09996673e313 b178af49 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/07/29 05:13 linux-5.15.y 09996673e313 92476829 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/07/14 19:38 linux-5.15.y d54cfc420586 d624500f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/07/11 05:01 linux-5.15.y d54cfc420586 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/07/11 03:27 linux-5.15.y d54cfc420586 d47e94ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/07/10 12:50 linux-5.15.y d54cfc420586 d47e94ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
2023/03/17 13:15 linux-5.15.y 8020ae3c051d 18b58603 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in path_openat
* Struck through repros no longer work on HEAD.