possible deadlock in process_measurement (2)

Status: upstream: reported on 2026/08/04 15:46
Reported-by: syzbot+8af2a339711decf34817@syzkaller.appspotmail.com
First crash: 5d01h, last: 3d19h
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in process_measurement (5) integrity lsm 4 49 314d 451d 0/29 auto-obsoleted due to no activity on 2025/12/07 20:43
upstream possible deadlock in process_measurement (4) integrity lsm 4 syz, C done 7976 643d 680d 28/29 fixed on 2024/11/14 10:09
upstream possible deadlock in process_measurement (2) integrity lsm 4 syz, C done done 56 2074d 2441d 15/29 fixed on 2021/01/06 01:14
upstream possible deadlock in process_measurement (3) overlayfs 4 syz, C error 223 1010d 1917d 0/29 closed as dup on 2023/06/06 09:59
upstream possible deadlock in process_measurement (6) integrity lsm prio:low 4 244 2h14m 10d 0/29 upstream: reported on 2026/07/30 00:19
linux-4.19 possible deadlock in process_measurement 4 156 1425d 2397d 0/1 auto-obsoleted due to no activity on 2023/01/11 22:20
upstream possible deadlock in process_measurement integrity lsm 4 syz, C 51 2622d 2855d 0/29 closed as invalid on 2019/07/15 16:35
linux-6.1 possible deadlock in process_measurement origin:lts-only 4 syz, C unreliable 4190 6h02m 1072d 0/3 upstream: reported C repro on 2023/09/02 00:54
linux-5.15 possible deadlock in process_measurement origin:lts-only 4 syz, C done 4 995d 1070d 0/3 auto-obsoleted due to no activity on 2024/10/03 14:31

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
udevd/4330 is trying to acquire lock:
ffff888061ac4e60 (&iint_mutex_key[depth]){+.+.}-{3:3}, at: process_measurement+0x724/0x1c20 security/integrity/ima/ima_main.c:261

but task is already holding lock:
ffff88807ea16460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (sb_writers#3){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1811 [inline]
       sb_start_write+0x4f/0x1c0 include/linux/fs.h:1881
       mnt_want_write+0x3d/0x90 fs/namespace.c:386
       open_last_lookups fs/namei.c:3529 [inline]
       path_openat+0x795/0x2fb0 fs/namei.c:3747
       do_filp_open+0x1df/0x400 fs/namei.c:3777
       file_open_name fs/open.c:1200 [inline]
       filp_open+0x17c/0x1e0 fs/open.c:1220
       fsg_lun_open+0x63/0xee0 drivers/usb/gadget/function/storage_common.c:193
       fsg_store_file+0x1a5/0x530 drivers/usb/gadget/function/storage_common.c:454
       flush_write_buffer fs/configfs/file.c:207 [inline]
       configfs_write_iter+0x30b/0x400 fs/configfs/file.c:229
       call_write_iter include/linux/fs.h:2173 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x748/0xd70 fs/read_write.c:594
       ksys_write+0x153/0x260 fs/read_write.c:647
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #3 (&common->filesem){+.+.}-{3:3}:
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       fsg_store_file+0x174/0x530 drivers/usb/gadget/function/storage_common.c:451
       flush_write_buffer fs/configfs/file.c:207 [inline]
       configfs_write_iter+0x30b/0x400 fs/configfs/file.c:229
       call_write_iter include/linux/fs.h:2173 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x748/0xd70 fs/read_write.c:594
       ksys_write+0x153/0x260 fs/read_write.c:647
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (&p->frag_sem){.+.+}-{3:3}:
       down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
       fill_read_buffer fs/configfs/file.c:66 [inline]
       configfs_read_iter+0x19e/0x560 fs/configfs/file.c:88
       __kernel_read+0x51d/0x980 fs/read_write.c:443
       integrity_kernel_read+0x86/0xd0 security/integrity/iint.c:228
       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+0x946/0x1940 security/integrity/ima/ima_crypto.c:573
       ima_collect_measurement+0x335/0x7e0 security/integrity/ima/ima_api.c:255
       process_measurement+0x1185/0x1c20 security/integrity/ima/ima_main.c:351
       ima_file_check+0xc7/0x110 security/integrity/ima/ima_main.c:533
       do_open fs/namei.c:3618 [inline]
       path_openat+0x27cf/0x2fb0 fs/namei.c:3750
       do_filp_open+0x1df/0x400 fs/namei.c:3777
       do_sys_openat2+0x14b/0x500 fs/open.c:1255
       do_sys_open fs/open.c:1271 [inline]
       __do_sys_openat fs/open.c:1287 [inline]
       __se_sys_openat fs/open.c:1282 [inline]
       __x64_sys_openat+0x135/0x160 fs/open.c:1282
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&buffer->mutex){+.+.}-{3:3}:
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       configfs_read_iter+0x6e/0x560 fs/configfs/file.c:86
       __kernel_read+0x51d/0x980 fs/read_write.c:443
       integrity_kernel_read+0x86/0xd0 security/integrity/iint.c:228
       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+0x946/0x1940 security/integrity/ima/ima_crypto.c:573
       ima_collect_measurement+0x335/0x7e0 security/integrity/ima/ima_api.c:255
       process_measurement+0x1185/0x1c20 security/integrity/ima/ima_main.c:351
       ima_file_check+0xc7/0x110 security/integrity/ima/ima_main.c:533
       do_open fs/namei.c:3618 [inline]
       path_openat+0x27cf/0x2fb0 fs/namei.c:3750
       do_filp_open+0x1df/0x400 fs/namei.c:3777
       do_sys_openat2+0x14b/0x500 fs/open.c:1255
       do_sys_open fs/open.c:1271 [inline]
       __do_sys_openat fs/open.c:1287 [inline]
       __se_sys_openat fs/open.c:1282 [inline]
       __x64_sys_openat+0x135/0x160 fs/open.c:1282
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&iint_mutex_key[depth]){+.+.}-{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:3788 [inline]
       __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
       lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       process_measurement+0x724/0x1c20 security/integrity/ima/ima_main.c:261
       ima_file_check+0xc7/0x110 security/integrity/ima/ima_main.c:533
       do_open fs/namei.c:3618 [inline]
       path_openat+0x27cf/0x2fb0 fs/namei.c:3750
       do_filp_open+0x1df/0x400 fs/namei.c:3777
       do_sys_openat2+0x14b/0x500 fs/open.c:1255
       do_sys_open fs/open.c:1271 [inline]
       __do_sys_openat fs/open.c:1287 [inline]
       __se_sys_openat fs/open.c:1282 [inline]
       __x64_sys_openat+0x135/0x160 fs/open.c:1282
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
  &iint_mutex_key[depth] --> &common->filesem --> sb_writers#3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_writers#3);
                               lock(&common->filesem);
                               lock(sb_writers#3);
  lock(&iint_mutex_key[depth]);

 *** DEADLOCK ***

1 lock held by udevd/4330:
 #0: ffff88807ea16460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386

stack backtrace:
CPU: 0 PID: 4330 Comm: udevd Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 check_noncircular+0x296/0x330 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:3788 [inline]
 __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 process_measurement+0x724/0x1c20 security/integrity/ima/ima_main.c:261
 ima_file_check+0xc7/0x110 security/integrity/ima/ima_main.c:533
 do_open fs/namei.c:3618 [inline]
 path_openat+0x27cf/0x2fb0 fs/namei.c:3750
 do_filp_open+0x1df/0x400 fs/namei.c:3777
 do_sys_openat2+0x14b/0x500 fs/open.c:1255
 do_sys_open fs/open.c:1271 [inline]
 __do_sys_openat fs/open.c:1287 [inline]
 __se_sys_openat fs/open.c:1282 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1282
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fb7d444a407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffca60c8800 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fb7d435c880 RCX: 00007fb7d444a407
RDX: 00000000000a0241 RSI: 00007ffca60c94c0 RDI: ffffffffffffff9c
RBP: 0000560a13b7dda0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000124 R11: 0000000000000202 R12: 0000560a13b59ba0
R13: 00007ffca60c94c0 R14: 00007ffca60c90c0 R15: 00007ffca60c8cc0
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/05 21:28 linux-5.15.y 6e2fd6534337 cd5b1963 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in process_measurement
2026/08/04 15:45 linux-5.15.y 6e2fd6534337 d4abbeac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in process_measurement
* Struck through repros no longer work on HEAD.