possible deadlock in configfs_read_iter

Status: upstream: reported on 2026/10/09 21:59
Reported-by: syzbot+90436c505a8493f2624a@syzkaller.appspotmail.com
First crash: 25d, last: 25d
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in configfs_read_iter prio:low lsm integrity 4 syz, C 38 5d14h 97d 0/29 upstream: reported C repro on 2026/07/29 05:27

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.5.3028/16065 is trying to acquire lock:
ffff88803babb088 (&buffer->mutex){+.+.}-{3:3}, at: configfs_read_iter+0x72/0x570 fs/configfs/file.c:86

but task is already holding lock:
ffff888075e2d9c0 (&iint_mutex_key[depth]){+.+.}-{3:3}, at: process_measurement+0x739/0x1d50 security/integrity/ima/ima_main.c:275

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #6 (&iint_mutex_key[depth]){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       process_measurement+0x739/0x1d50 security/integrity/ima/ima_main.c:275
       ima_file_check+0xcc/0x110 security/integrity/ima/ima_main.c:568
       do_open fs/namei.c:3685 [inline]
       path_openat+0x2910/0x3270 fs/namei.c:3844
       do_file_open_root+0x2f3/0x5a0 fs/namei.c:3896
       file_open_root+0x167/0x1c0 fs/open.c:1402
       kernel_read_file_from_path_initns+0x151/0x230 fs/kernel_read_file.c:163
       fw_get_filesystem_firmware drivers/base/firmware_loader/main.c:548 [inline]
       _request_firmware+0xb43/0x1520 drivers/base/firmware_loader/main.c:911
       request_firmware+0x36/0x50 drivers/base/firmware_loader/main.c:987
       reg_reload_regdb+0x9a/0x490 net/wireless/reg.c:1078
       genl_family_rcv_msg_doit+0x21a/0x310 net/netlink/genetlink.c:971
       genl_family_rcv_msg net/netlink/genetlink.c:1051 [inline]
       genl_rcv_msg+0x611/0x7a0 net/netlink/genetlink.c:1066
       netlink_rcv_skb+0x235/0x4c0 net/netlink/af_netlink.c:2550
       genl_rcv+0x28/0x40 net/netlink/genetlink.c:1075
       netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
       netlink_unicast+0x7b1/0x930 net/netlink/af_netlink.c:1346
       netlink_sendmsg+0x8d0/0xbf0 net/netlink/af_netlink.c:1899
       sock_sendmsg_nosec net/socket.c:730 [inline]
       __sock_sendmsg net/socket.c:745 [inline]
       ____sys_sendmsg+0x61b/0x980 net/socket.c:2595
       ___sys_sendmsg+0x2a6/0x360 net/socket.c:2649
       __sys_sendmsg net/socket.c:2678 [inline]
       __do_sys_sendmsg net/socket.c:2687 [inline]
       __se_sys_sendmsg+0x1d0/0x2c0 net/socket.c:2685
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #5 (cb_lock){++++}-{3:3}:
       down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
       genl_rcv+0x19/0x40 net/netlink/genetlink.c:1074
       netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
       netlink_unicast+0x7b1/0x930 net/netlink/af_netlink.c:1346
       netlink_sendmsg+0x8d0/0xbf0 net/netlink/af_netlink.c:1899
       sock_sendmsg_nosec net/socket.c:730 [inline]
       __sock_sendmsg net/socket.c:745 [inline]
       sock_sendmsg+0x23b/0x3a0 net/socket.c:768
       splice_to_socket+0xb92/0x1270 fs/splice.c:881
       do_splice_from fs/splice.c:933 [inline]
       do_splice+0xe45/0x1b20 fs/splice.c:1292
       __do_splice fs/splice.c:1370 [inline]
       __do_sys_splice fs/splice.c:1586 [inline]
       __se_sys_splice+0x398/0x4a0 fs/splice.c:1568
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #4 (&pipe->mutex/1){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       iter_file_splice_write+0x1ba/0xcf0 fs/splice.c:683
       do_splice_from fs/splice.c:933 [inline]
       do_splice+0xe45/0x1b20 fs/splice.c:1292
       __do_splice fs/splice.c:1370 [inline]
       __do_sys_splice fs/splice.c:1586 [inline]
       __se_sys_splice+0x398/0x4a0 fs/splice.c:1568
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #3 (sb_writers#5){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1633 [inline]
       sb_start_write+0x4d/0x1c0 include/linux/fs.h:1708
       mnt_want_write+0x41/0x90 fs/namespace.c:412
       open_last_lookups fs/namei.c:3596 [inline]
       path_openat+0x768/0x3270 fs/namei.c:3841
       do_filp_open+0x1f2/0x430 fs/namei.c:3871
       file_open_name fs/open.c:1367 [inline]
       filp_open+0x180/0x1e0 fs/open.c:1387
       nvmet_file_ns_enable+0x74/0x330 drivers/nvme/target/io-cmd-file.c:41
       nvmet_ns_enable+0xf4/0x8c0 drivers/nvme/target/core.c:578
       nvmet_ns_enable_store+0xd8/0x170 drivers/nvme/target/configfs.c:549
       flush_write_buffer fs/configfs/file.c:207 [inline]
       configfs_write_iter+0x312/0x400 fs/configfs/file.c:229
       call_write_iter include/linux/fs.h:2018 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x474/0x9a0 fs/read_write.c:584
       ksys_write+0x151/0x260 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #2 (&subsys->lock){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       nvmet_ns_buffered_io_store+0xe2/0x200 drivers/nvme/target/configfs.c:573
       flush_write_buffer fs/configfs/file.c:207 [inline]
       configfs_write_iter+0x312/0x400 fs/configfs/file.c:229
       call_write_iter include/linux/fs.h:2018 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x474/0x9a0 fs/read_write.c:584
       ksys_write+0x151/0x260 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&p->frag_sem){.+.+}-{3:3}:
       down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
       flush_write_buffer fs/configfs/file.c:205 [inline]
       configfs_write_iter+0x215/0x400 fs/configfs/file.c:229
       call_write_iter include/linux/fs.h:2018 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x474/0x9a0 fs/read_write.c:584
       ksys_write+0x151/0x260 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&buffer->mutex){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3162 [inline]
       check_prevs_add kernel/locking/lockdep.c:3281 [inline]
       validate_chain kernel/locking/lockdep.c:3897 [inline]
       __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       configfs_read_iter+0x72/0x570 fs/configfs/file.c:86
       __kernel_read+0x2e5/0x730 fs/read_write.c:428
       integrity_kernel_read+0x8a/0xd0 security/integrity/iint.c:221
       ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline]
       ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline]
       ima_calc_file_hash+0xb1f/0x1960 security/integrity/ima/ima_crypto.c:573
       ima_collect_measurement+0x4d4/0xa30 security/integrity/ima/ima_api.c:290
       process_measurement+0x123a/0x1d50 security/integrity/ima/ima_main.c:370
       ima_file_check+0xcc/0x110 security/integrity/ima/ima_main.c:568
       do_open fs/namei.c:3685 [inline]
       path_openat+0x2910/0x3270 fs/namei.c:3844
       do_filp_open+0x1f2/0x430 fs/namei.c:3871
       do_sys_openat2+0x134/0x1d0 fs/open.c:1422
       do_sys_open fs/open.c:1437 [inline]
       __do_sys_openat fs/open.c:1453 [inline]
       __se_sys_openat fs/open.c:1448 [inline]
       __x64_sys_openat+0x139/0x160 fs/open.c:1448
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  &buffer->mutex --> cb_lock --> &iint_mutex_key[depth]

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&iint_mutex_key[depth]);
                               lock(cb_lock);
                               lock(&iint_mutex_key[depth]);
  lock(&buffer->mutex);

 *** DEADLOCK ***

1 lock held by syz.5.3028/16065:
 #0: ffff888075e2d9c0 (&iint_mutex_key[depth]){+.+.}-{3:3}, at: process_measurement+0x739/0x1d50 security/integrity/ima/ima_main.c:275

stack backtrace:
CPU: 1 PID: 16065 Comm: syz.5.3028 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215
 check_prev_add kernel/locking/lockdep.c:3162 [inline]
 check_prevs_add kernel/locking/lockdep.c:3281 [inline]
 validate_chain kernel/locking/lockdep.c:3897 [inline]
 __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
 configfs_read_iter+0x72/0x570 fs/configfs/file.c:86
 __kernel_read+0x2e5/0x730 fs/read_write.c:428
 integrity_kernel_read+0x8a/0xd0 security/integrity/iint.c:221
 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline]
 ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline]
 ima_calc_file_hash+0xb1f/0x1960 security/integrity/ima/ima_crypto.c:573
 ima_collect_measurement+0x4d4/0xa30 security/integrity/ima/ima_api.c:290
 process_measurement+0x123a/0x1d50 security/integrity/ima/ima_main.c:370
 ima_file_check+0xcc/0x110 security/integrity/ima/ima_main.c:568
 do_open fs/namei.c:3685 [inline]
 path_openat+0x2910/0x3270 fs/namei.c:3844
 do_filp_open+0x1f2/0x430 fs/namei.c:3871
 do_sys_openat2+0x134/0x1d0 fs/open.c:1422
 do_sys_open fs/open.c:1437 [inline]
 __do_sys_openat fs/open.c:1453 [inline]
 __se_sys_openat fs/open.c:1448 [inline]
 __x64_sys_openat+0x139/0x160 fs/open.c:1448
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1841f9e1d9
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:00007f1842dcd028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f1842225fa0 RCX: 00007f1841f9e1d9
RDX: 0000000000000002 RSI: 0000200000000d00 RDI: ffffffffffffff9c
RBP: 00007f1842035888 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1842226038 R14: 00007f1842225fa0 R15: 00007ffd93f566d8
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/09 21:58 linux-6.6.y a91a6aa9253c 4f92358f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in configfs_read_iter
* Struck through repros no longer work on HEAD.