possible deadlock in array_state_store

Status: upstream: reported on 2026/10/25 04:50
Subsystems: kernfs
[Documentation on labels]
Reported-by: syzbot+7657131267c5111921e2@syzkaller.appspotmail.com
First crash: 9d05h, last: 1d01h
▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
167f59ac repro-c Reproduced: ✅ ❓ possible deadlock in array_state_store 2026/10/24 04:12 2026/10/24 04:12 2026/10/24 08:46 1d9ca40b
0fa5152b assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ possible deadlock in array_state_store 2026/10/23 00:00 2026/10/23 00:00 2026/10/23 00:57 33f73a1b
▶ ▼ Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernfs?] possible deadlock in array_state_store 0 (1) 2026/10/25 04:50
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in array_state_store 4 1 86d 86d 0/3 upstream: reported on 2026/08/04 18:02
▶ ▼ Last patch testing requests (1)
Created Duration User Patch Repo Result
2026/10/24 08:47 13m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 4da9dedf3fc59137fd86d664693776aa38cb97f5 report job log log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.405/7663 is trying to acquire lock:
ffff88802d37c340 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: mddev_lock drivers/md/md.h:713 [inline]
ffff88802d37c340 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: array_state_store+0x4a5/0xe90 drivers/md/md.c:4705

but task is already holding lock:
ffff88806574a5a8 (kn->active#67){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline]
ffff88806574a5a8 (kn->active#67){++++}-{0:0}, at: kernfs_fop_write_iter+0x22c/0x540 fs/kernfs/file.c:337

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (kn->active#67){++++}-{0:0}:
       kernfs_drain+0x293/0x640 fs/kernfs/dir.c:534
       __kernfs_remove+0x493/0x910 fs/kernfs/dir.c:1578
       kernfs_remove_by_name_ns+0xc0/0x140 fs/kernfs/dir.c:1796
       kernfs_remove_by_name include/linux/kernfs.h:644 [inline]
       remove_files fs/sysfs/group.c:28 [inline]
       sysfs_remove_group+0x101/0x2e0 fs/sysfs/group.c:328
       sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:352
       __kobject_del+0x83/0x320 lib/kobject.c:595
       kobject_cleanup lib/kobject.c:680 [inline]
       kobject_release lib/kobject.c:720 [inline]
       kref_put include/linux/kref.h:65 [inline]
       kobject_put+0x23a/0x550 lib/kobject.c:737
       process_one_work kernel/workqueue.c:3495 [inline]
       process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578
       worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659
       kthread+0x38b/0x470 kernel/kthread.c:436
       ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

-> #3 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}:
       process_one_work kernel/workqueue.c:3471 [inline]
       process_scheduled_works+0xc03/0x1630 kernel/workqueue.c:3578
       worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659
       kthread+0x38b/0x470 kernel/kthread.c:436
       ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

-> #2 ((wq_completion)md_misc){+.+.}-{0:0}:
       touch_wq_lockdep_map+0xcb/0x180 kernel/workqueue.c:4272
       __flush_workqueue+0x148/0x10b0 kernel/workqueue.c:4314
       md_alloc+0x32/0xf20 drivers/md/md.c:6334
       md_alloc_and_put+0x1a/0x1f0 drivers/md/md.c:6423
       blk_probe_dev block/genhd.c:888 [inline]
       blk_request_module+0x27d/0x2a0 block/genhd.c:-1
       blkdev_get_no_open+0x3f/0xe0 block/bdev.c:870
       blkdev_open+0x1e9/0x630 block/fops.c:677
       do_dentry_open+0x841/0x1410 fs/open.c:1000
       vfs_open_consume+0x4a/0x360 fs/open.c:1131
       do_open fs/namei.c:4845 [inline]
       path_openat+0x1701/0x2100 fs/namei.c:5010
       do_file_open+0x23e/0x4a0 fs/namei.c:5039
       do_sys_openat2+0x115/0x200 fs/open.c:1442
       do_sys_open fs/open.c:1448 [inline]
       __do_sys_openat fs/open.c:1464 [inline]
       __se_sys_openat fs/open.c:1459 [inline]
       __x64_sys_openat+0x138/0x170 fs/open.c:1459
       do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
       do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (major_names_lock){+.+.}-{4:4}:
       __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline]
       mutex_lock_nested+0x55/0x1d0 kernel/locking/rtmutex_api.c:580
       blk_probe_dev block/genhd.c:885 [inline]
       blk_request_module+0x35/0x2a0 block/genhd.c:901
       blkdev_get_no_open+0x3f/0xe0 block/bdev.c:870
       bdev_file_open_by_dev+0xa0/0x240 block/bdev.c:1091
       md_import_device+0x2e9/0x650 drivers/md/md.c:3847
       md_add_new_disk+0x3a3/0x1850 drivers/md/md.c:7507
       md_ioctl+0x2005/0x2610 drivers/md/md.c:8499
       blkdev_ioctl+0x5e6/0x750 block/ioctl.c:798
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:597 [inline]
       __se_sys_ioctl+0xff/0x170 fs/ioctl.c:583
       do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
       do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&mddev->reconfig_mutex){+.+.}-{4:4}:
       check_prev_add kernel/locking/lockdep.c:3209 [inline]
       check_prevs_add kernel/locking/lockdep.c:3328 [inline]
       validate_chain kernel/locking/lockdep.c:3952 [inline]
       __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288
       lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942
       __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline]
       mutex_lock_interruptible_nested+0x55/0x1c0 kernel/locking/rtmutex_api.c:594
       mddev_lock drivers/md/md.h:713 [inline]
       array_state_store+0x4a5/0xe90 drivers/md/md.c:4705
       md_attr_store+0x3b7/0x640 drivers/md/md.c:6158
       kernfs_fop_write_iter+0x3a5/0x540 fs/kernfs/file.c:345
       new_sync_write fs/read_write.c:595 [inline]
       vfs_write+0x61e/0xbb0 fs/read_write.c:687
       ksys_write+0x156/0x270 fs/read_write.c:739
       do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
       do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  &mddev->reconfig_mutex --> (work_completion)(&mddev->del_work) --> kn->active#67

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(kn->active#67);
                               lock((work_completion)(&mddev->del_work));
                               lock(kn->active#67);
  lock(&mddev->reconfig_mutex);

 *** DEADLOCK ***

locks held by syz.4.405/7663: 5, last CPU#0:
 #0: ffff88803d927928 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x11e/0x160 fs/file.c:1409
 #1: ffff888036e3c510 (sb_writers#7){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2760 [inline]
 #1: ffff888036e3c510 (sb_writers#7){.+.+}-{0:0}, at: vfs_write+0x231/0xbb0 fs/read_write.c:683
 #2: ffff88801c39e4f8 (&of->prealloc_mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x148/0x540 fs/kernfs/file.c:320
 #3: ffff88801c39e478 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x1d9/0x540 fs/kernfs/file.c:336
 #4: ffff88806574a5a8 (kn->active#67){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline]
 #4: ffff88806574a5a8 (kn->active#67){++++}-{0:0}, at: kernfs_fop_write_iter+0x22c/0x540 fs/kernfs/file.c:337

stack backtrace:
CPU: 0 UID: 0 PID: 7663 Comm: syz.4.405 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087
 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219
 check_prev_add kernel/locking/lockdep.c:3209 [inline]
 check_prevs_add kernel/locking/lockdep.c:3328 [inline]
 validate_chain kernel/locking/lockdep.c:3952 [inline]
 __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288
 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942
 __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline]
 mutex_lock_interruptible_nested+0x55/0x1c0 kernel/locking/rtmutex_api.c:594
 mddev_lock drivers/md/md.h:713 [inline]
 array_state_store+0x4a5/0xe90 drivers/md/md.c:4705
 md_attr_store+0x3b7/0x640 drivers/md/md.c:6158
 kernfs_fop_write_iter+0x3a5/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x61e/0xbb0 fs/read_write.c:687
 ksys_write+0x156/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcb4a2ef559
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fcb4851d028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fcb4a576090 RCX: 00007fcb4a2ef559
RDX: 0000000000000006 RSI: 0000200000000440 RDI: 0000000000000007
RBP: 00007fcb4a386b20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fcb4a576128 R14: 00007fcb4a576090 R15: 00007ffef3fceaf8
 </TASK>

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/28 20:39 upstream 65ba8f34ec88 858db2ec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in array_state_store
2026/10/29 08:45 upstream c339f4010dea b1d00f76 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in array_state_store
2026/10/23 08:55 upstream 3ac032ef6ca8 d566bfda .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in array_state_store
2026/10/22 03:41 upstream 4df4d2a577db 4ba27f85 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in array_state_store
2026/10/21 04:43 upstream 4cbdd58dfa7a 61c200c7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in array_state_store
2026/10/21 23:11 linux-next 9a482184d910 61c200c7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce possible deadlock in array_state_store
2026/10/21 14:01 linux-next 8f7df005a756 61c200c7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in array_state_store
2026/10/24 15:42 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7a19f0cc94ad 1d9ca40b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in array_state_store
* Struck through repros no longer work on HEAD.