====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.5.603/8371 is trying to acquire lock: ffff88807e6249c0 (&iint_mutex_key[depth]){+.+.}-{3:3}, at: process_measurement+0x739/0x1d50 security/integrity/ima/ima_main.c:275 but task is already holding lock: ffff888058ad2418 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (sb_writers#16){.+.+}-{0:0} : percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1634 [inline] sb_start_write+0x4d/0x1c0 include/linux/fs.h:1709 mnt_want_write+0x41/0x90 fs/namespace.c:412 open_last_lookups fs/namei.c:3608 [inline] path_openat+0x768/0x3270 fs/namei.c:3853 do_filp_open+0x1f2/0x430 fs/namei.c:3883 file_open_name fs/open.c:1367 [inline] filp_open+0x180/0x1e0 fs/open.c:1387 fsg_lun_open+0x67/0xec0 drivers/usb/gadget/function/storage_common.c:194 fsg_store_file+0x1a9/0x530 drivers/usb/gadget/function/storage_common.c:455 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:2019 [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 -> #3 ( &common->filesem){++++}-{3:3}: down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 fsg_show_file+0x2d/0x130 drivers/usb/gadget/function/storage_common.c:339 fill_read_buffer fs/configfs/file.c:68 [inline] configfs_read_iter+0x29d/0x570 fs/configfs/file.c:88 __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:3697 [inline] path_openat+0x2910/0x3270 fs/namei.c:3856 do_filp_open+0x1f2/0x430 fs/namei.c:3883 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 -> #2 (&p->frag_sem){.+.+}-{3:3}: down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 fill_read_buffer fs/configfs/file.c:66 [inline] configfs_read_iter+0x1a5/0x570 fs/configfs/file.c:88 __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:3697 [inline] path_openat+0x2910/0x3270 fs/namei.c:3856 do_filp_open+0x1f2/0x430 fs/namei.c:3883 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 -> #1 (&buffer->mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xce0 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:3697 [inline] path_openat+0x2910/0x3270 fs/namei.c:3856 do_filp_open+0x1f2/0x430 fs/namei.c:3883 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 -> #0 (&iint_mutex_key[depth]){+.+.}-{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/0xce0 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:3697 [inline] path_openat+0x2910/0x3270 fs/namei.c:3856 do_filp_open+0x1f2/0x430 fs/namei.c:3883 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: &iint_mutex_key[depth] --> &common->filesem --> sb_writers#16 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_writers#16); lock(&common->filesem); lock(sb_writers#16); lock(&iint_mutex_key[depth]); *** DEADLOCK *** 1 lock held by syz.5.603/8371: #0: ffff888058ad2418 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412 stack backtrace: CPU: 1 PID: 8371 Comm: syz.5.603 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: 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/0xce0 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:3697 [inline] path_openat+0x2910/0x3270 fs/namei.c:3856 do_filp_open+0x1f2/0x430 fs/namei.c:3883 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:0x7f37cf9a94d9 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:00007f37d08ca028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f37cfc26090 RCX: 00007f37cf9a94d9 RDX: 0000000000103a42 RSI: 000020000000b440 RDI: ffffffffffffff9c RBP: 00007f37cfa3804e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000032 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f37cfc26128 R14: 00007f37cfc26090 R15: 00007ffe318b5ee8 kcov: kcov_task_exit: t = ffff888023fd9e00, kcov->t = ffff888023fd9e00 syzkaller1 (unregistering): bond_netdev_event received NETDEV_UNREGISTER net syzkaller1: siw: event 6 syzkaller1 (unregistering): bond_netdev_event received NETDEV_PRE_UNINIT net syzkaller1: siw: event 18 kobject: 'rx-0' (ffff888032794450): kobject_cleanup, parent ffff8880316b3b50 kobject: 'rx-0' (ffff888032794450): auto cleanup kobject_del kernfs rps_cpus: removing kernfs rps_flow_cnt: removing kobject: 'rx-0' (ffff888032794450): auto cleanup 'remove' event kobject: 'rx-0' (ffff888032794450): kobject_uevent_env kobject: 'rx-0' (ffff888032794450): fill_kobj_path: path = '/devices/virtual/net/syzkaller1/queues/rx-0' kernfs rx-0: removing kobject: 'rx-0' (ffff888032794450): calling ktype release kobject: 'rx-0': free name kernfs limit: removing kernfs limit_max: removing kernfs limit_min: removing kernfs hold_time: removing kernfs inflight: removing kernfs byte_queue_limits: removing kobject: 'tx-0' (ffff888022b1e820): kobject_cleanup, parent ffff8880316b3b50 kobject: 'tx-0' (ffff888022b1e820): auto cleanup kobject_del kernfs tx_timeout: removing kernfs traffic_class: removing kernfs xps_cpus: removing kernfs xps_rxqs: removing kernfs tx_maxrate: removing kobject: 'tx-0' (ffff888022b1e820): auto cleanup 'remove' event kobject: 'tx-0' (ffff888022b1e820): kobject_uevent_env kobject: 'tx-0' (ffff888022b1e820): fill_kobj_path: path = '/devices/virtual/net/syzkaller1/queues/tx-0' kernfs tx-0: removing kobject: 'tx-0' (ffff888022b1e820): calling ktype release kobject: 'tx-0': free name kernfs queues: removing kobject: 'queues' (ffff8880316b3b50): kobject_cleanup, parent 0000000000000000 kobject: 'queues' (ffff8880316b3b50): calling ktype release kobject: 'queues' (ffff8880316b3b50): kset_release kobject: 'queues': free name kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs subsystem: removing kernfs syzkaller1: removing kernfs uevent: removing kernfs tun_flags: removing kernfs owner: removing kernfs group: removing kernfs rx_packets: removing kernfs tx_packets: removing kernfs rx_bytes: removing kernfs tx_bytes: removing kernfs rx_errors: removing kernfs tx_errors: removing kernfs rx_dropped: removing kernfs tx_dropped: removing kernfs multicast: removing kernfs collisions: removing kernfs rx_length_errors: removing kernfs rx_over_errors: removing kernfs rx_crc_errors: removing kernfs rx_frame_errors: removing kernfs rx_fifo_errors: removing kernfs rx_missed_errors: removing kernfs tx_aborted_errors: removing kernfs tx_carrier_errors: removing kernfs tx_fifo_errors: removing kernfs tx_heartbeat_errors: removing kernfs tx_window_errors: removing kernfs rx_compressed: removing kernfs tx_compressed: removing kernfs rx_nohandler: removing kernfs statistics: removing kernfs netdev_group: removing kernfs type: removing kernfs dev_id: removing kernfs dev_port: removing kernfs iflink: removing kernfs ifindex: removing kernfs name_assign_type: removing kernfs addr_assign_type: removing kernfs addr_len: removing kernfs link_mode: removing kernfs address: removing kernfs broadcast: removing kernfs speed: removing kernfs duplex: removing kernfs dormant: removing kernfs testing: removing kernfs operstate: removing kernfs carrier_changes: removing kernfs ifalias: removing kernfs carrier: removing kernfs mtu: removing kernfs flags: removing kernfs tx_queue_len: removing kernfs gro_flush_timeout: removing kernfs napi_defer_hard_irqs: removing kernfs phys_port_id: removing kernfs phys_port_name: removing kernfs phys_switch_id: removing kernfs proto_down: removing kernfs carrier_up_count: removing kernfs carrier_down_count: removing kernfs threaded: removing PM: Removing info for No Bus:syzkaller1 kobject: 'syzkaller1' (ffff88801eb506f0): kobject_uevent_env kobject: 'syzkaller1' (ffff88801eb506f0): fill_kobj_path: path = '/devices/virtual/net/syzkaller1' kernfs syzkaller1: removing kobject: 'syzkaller1' (ffff88801eb506f0): kobject_cleanup, parent 0000000000000000 kobject: 'syzkaller1' (ffff88801eb506f0): calling ktype release kobject: 'syzkaller1': free name