WARNING: possible circular locking dependency detected 5.5.0-rc6-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.2/16798 is trying to acquire lock: ffff888076ba2428 (sb_writers#4){.+.+}, at: sb_start_write include/linux/fs.h:1650 [inline] ffff888076ba2428 (sb_writers#4){.+.+}, at: mnt_want_write+0x3f/0xc0 fs/namespace.c:354 but task is already holding lock: ffff8880248be4b8 (&iint->mutex){+.+.}, at: process_measurement+0x394/0x1850 security/integrity/ima/ima_main.c:249 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&iint->mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1118 process_measurement+0x394/0x1850 security/integrity/ima/ima_main.c:249 ima_file_check+0xc5/0x110 security/integrity/ima/ima_main.c:442 do_last fs/namei.c:3424 [inline] path_openat+0x1138/0x4500 fs/namei.c:3537 do_filp_open+0x1a1/0x280 fs/namei.c:3567 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_open fs/open.c:1115 [inline] __se_sys_open fs/open.c:1110 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1110 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (sb_writers#4){.+.+}: check_prev_add kernel/locking/lockdep.c:2476 [inline] check_prevs_add kernel/locking/lockdep.c:2581 [inline] validate_chain kernel/locking/lockdep.c:2971 [inline] __lock_acquire+0x2596/0x4a00 kernel/locking/lockdep.c:3955 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485 percpu_down_read include/linux/percpu-rwsem.h:40 [inline] __sb_start_write+0x241/0x460 fs/super.c:1674 sb_start_write include/linux/fs.h:1650 [inline] mnt_want_write+0x3f/0xc0 fs/namespace.c:354 ovl_want_write+0x76/0xa0 fs/overlayfs/util.c:21 ovl_maybe_copy_up+0x122/0x180 fs/overlayfs/copy_up.c:911 ovl_open+0xb8/0x270 fs/overlayfs/file.c:121 do_dentry_open+0x4e6/0x1380 fs/open.c:797 vfs_open fs/open.c:914 [inline] dentry_open+0x132/0x1d0 fs/open.c:930 ima_calc_file_hash+0x33f/0x570 security/integrity/ima/ima_crypto.c:431 ima_collect_measurement+0x534/0x5f0 security/integrity/ima/ima_api.c:247 process_measurement+0xd45/0x1850 security/integrity/ima/ima_main.c:326 ima_file_check+0xc5/0x110 security/integrity/ima/ima_main.c:442 do_last fs/namei.c:3424 [inline] path_openat+0x1138/0x4500 fs/namei.c:3537 do_filp_open+0x1a1/0x280 fs/namei.c:3567 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_open fs/open.c:1115 [inline] __se_sys_open fs/open.c:1110 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1110 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&iint->mutex); lock(sb_writers#4); lock(&iint->mutex); lock(sb_writers#4); *** DEADLOCK *** 1 lock held by syz-executor.2/16798: #0: ffff8880248be4b8 (&iint->mutex){+.+.}, at: process_measurement+0x394/0x1850 security/integrity/ima/ima_main.c:249 stack backtrace: CPU: 2 PID: 16798 Comm: syz-executor.2 Not tainted 5.5.0-rc6-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_circular_bug.isra.0.cold+0x163/0x172 kernel/locking/lockdep.c:1685 check_noncircular+0x32e/0x3e0 kernel/locking/lockdep.c:1809 check_prev_add kernel/locking/lockdep.c:2476 [inline] check_prevs_add kernel/locking/lockdep.c:2581 [inline] validate_chain kernel/locking/lockdep.c:2971 [inline] __lock_acquire+0x2596/0x4a00 kernel/locking/lockdep.c:3955 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485 percpu_down_read include/linux/percpu-rwsem.h:40 [inline] __sb_start_write+0x241/0x460 fs/super.c:1674 sb_start_write include/linux/fs.h:1650 [inline] mnt_want_write+0x3f/0xc0 fs/namespace.c:354 ovl_want_write+0x76/0xa0 fs/overlayfs/util.c:21 ovl_maybe_copy_up+0x122/0x180 fs/overlayfs/copy_up.c:911 ovl_open+0xb8/0x270 fs/overlayfs/file.c:121 do_dentry_open+0x4e6/0x1380 fs/open.c:797 vfs_open fs/open.c:914 [inline] dentry_open+0x132/0x1d0 fs/open.c:930 ima_calc_file_hash+0x33f/0x570 security/integrity/ima/ima_crypto.c:431 ima_collect_measurement+0x534/0x5f0 security/integrity/ima/ima_api.c:247 process_measurement+0xd45/0x1850 security/integrity/ima/ima_main.c:326 ima_file_check+0xc5/0x110 security/integrity/ima/ima_main.c:442 do_last fs/namei.c:3424 [inline] path_openat+0x1138/0x4500 fs/namei.c:3537 do_filp_open+0x1a1/0x280 fs/namei.c:3567 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_open fs/open.c:1115 [inline] __se_sys_open fs/open.c:1110 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1110 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45afd9 Code: bd b1 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 8b b1 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb25602bc88 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 000000000072bf00 RCX: 000000000045afd9 RDX: 0000000000000008 RSI: 0000000000040803 RDI: 0000000020000080 RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb25602c6d4 R13: 00000000004af657 R14: 00000000006f4ee0 R15: 00000000ffffffff