====================================================== WARNING: possible circular locking dependency detected 4.14.307-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/9544 is trying to acquire lock: (sb_writers#3){.+.+}, at: [] sb_start_write include/linux/fs.h:1551 [inline] (sb_writers#3){.+.+}, at: [] mnt_want_write+0x3a/0xb0 fs/namespace.c:386 but task is already holding lock: (&iint->mutex){+.+.}, at: [] process_measurement+0x270/0xb20 security/integrity/ima/ima_main.c:225 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:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 process_measurement+0x270/0xb20 security/integrity/ima/ima_main.c:225 do_last fs/namei.c:3435 [inline] path_openat+0x10ad/0x2970 fs/namei.c:3571 do_filp_open+0x179/0x3c0 fs/namei.c:3605 do_sys_open+0x296/0x410 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #0 (sb_writers#3){.+.+}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x64/0x260 fs/super.c:1342 sb_start_write include/linux/fs.h:1551 [inline] mnt_want_write+0x3a/0xb0 fs/namespace.c:386 ovl_open_maybe_copy_up+0xcf/0x130 fs/overlayfs/inode.c:344 ovl_d_real+0xbc/0x350 fs/overlayfs/super.c:88 d_real include/linux/dcache.h:587 [inline] vfs_open+0x19e/0x220 fs/open.c:882 dentry_open+0xa7/0x210 fs/open.c:905 ima_calc_file_hash+0x51c/0x780 security/integrity/ima/ima_crypto.c:452 ima_collect_measurement+0x39d/0x430 security/integrity/ima/ima_api.c:227 process_measurement+0x78b/0xb20 security/integrity/ima/ima_main.c:264 do_last fs/namei.c:3435 [inline] path_openat+0x10ad/0x2970 fs/namei.c:3571 do_filp_open+0x179/0x3c0 fs/namei.c:3605 do_sys_open+0x296/0x410 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&iint->mutex); lock(sb_writers#3); lock(&iint->mutex); lock(sb_writers#3); *** DEADLOCK *** 1 lock held by syz-executor.3/9544: #0: (&iint->mutex){+.+.}, at: [] process_measurement+0x270/0xb20 security/integrity/ima/ima_main.c:225 stack backtrace: CPU: 0 PID: 9544 Comm: syz-executor.3 Not tainted 4.14.307-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x64/0x260 fs/super.c:1342 sb_start_write include/linux/fs.h:1551 [inline] mnt_want_write+0x3a/0xb0 fs/namespace.c:386 ovl_open_maybe_copy_up+0xcf/0x130 fs/overlayfs/inode.c:344 ovl_d_real+0xbc/0x350 fs/overlayfs/super.c:88 d_real include/linux/dcache.h:587 [inline] vfs_open+0x19e/0x220 fs/open.c:882 dentry_open+0xa7/0x210 fs/open.c:905 ima_calc_file_hash+0x51c/0x780 security/integrity/ima/ima_crypto.c:452 ima_collect_measurement+0x39d/0x430 security/integrity/ima/ima_api.c:227 process_measurement+0x78b/0xb20 security/integrity/ima/ima_main.c:264 do_last fs/namei.c:3435 [inline] path_openat+0x10ad/0x2970 fs/namei.c:3571 do_filp_open+0x179/0x3c0 fs/namei.c:3605 do_sys_open+0x296/0x410 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 RIP: 0033:0x7fc7a78080f9 RSP: 002b:00007fc7a5d7a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fc7a7927f80 RCX: 00007fc7a78080f9 RDX: 0000000000000003 RSI: 0000000020000180 RDI: ffffffffffffff9c RBP: 00007fc7a7863ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdf1b526df R14: 00007fc7a5d7a300 R15: 0000000000022000 autofs4:pid:9642:check_dev_ioctl_version: ioctl control interface version mismatch: kernel(1.1), user(1.2214592513), cmd(0xc0189376) autofs4:pid:9642:validate_dev_ioctl: invalid device control module version supplied for cmd(0xc0189376) IPVS: ftp: loaded support on port[0] = 21 netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.0'. autofs4:pid:9809:check_dev_ioctl_version: ioctl control interface version mismatch: kernel(1.1), user(1.16), cmd(0xc0189373) autofs4:pid:9809:validate_dev_ioctl: invalid device control module version supplied for cmd(0xc0189373) erspan0: Invalid MTU 0 requested, hw min 68 RDS: rds_bind could not find a transport for 100.1.1.0, load rds_tcp or rds_rdma? nla_parse: 54 callbacks suppressed netlink: 28 bytes leftover after parsing attributes in process `syz-executor.2'. EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue netlink: 28 bytes leftover after parsing attributes in process `syz-executor.2'. tmpfs: Bad value 'prefer=relative' for mount option 'mpol' hrtimer: interrupt took 31513 ns RDS: rds_bind could not find a transport for 100.1.1.0, load rds_tcp or rds_rdma? F2FS-fs (loop3): Invalid log sectorsize (3) F2FS-fs (loop3): Can't find valid F2FS filesystem in 1th superblock RDS: rds_bind could not find a transport for 100.1.1.0, load rds_tcp or rds_rdma? audit: type=1804 audit(1678045705.054:2): pid=10405 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir2314965326/syzkaller.CMD9dw/57/file0/bus" dev="loop1" ino=18 res=1 F2FS-fs (loop3): Insane cp_payload (4271636480 > 510) F2FS-fs (loop3): Can't find valid F2FS filesystem in 2th superblock F2FS-fs (loop3): Invalid log sectorsize (3) F2FS-fs (loop3): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop3): Insane cp_payload (4271636480 > 510) F2FS-fs (loop3): Can't find valid F2FS filesystem in 2th superblock RDS: rds_bind could not find a transport for 100.1.1.0, load rds_tcp or rds_rdma? BTRFS: device fsid 24c7a497-3402-47dd-bef8-82358f5f30e0 devid 1 transid 8 /dev/loop2 BTRFS info (device loop2): enabling inode map caching BTRFS info (device loop2): force clearing of disk cache BTRFS info (device loop2): disabling free space tree BTRFS info (device loop2): has skinny extents BTRFS info (device loop2): clearing free space tree BTRFS info (device loop2): clearing 1 ro feature flag BTRFS info (device loop2): clearing 2 ro feature flag BTRFS info (device loop2): checking UUID tree tmpfs: Bad value 'prefer=relative' for mount option 'mpol' syz-executor.2 (10480) used greatest stack depth: 24464 bytes left audit: type=1804 audit(1678045705.905:3): pid=10557 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir2314965326/syzkaller.CMD9dw/58/bus" dev="sda1" ino=14015 res=1 F2FS-fs (loop3): Invalid log sectorsize (3) F2FS-fs (loop3): Can't find valid F2FS filesystem in 1th superblock tmpfs: Bad value 'prefer=relative' for mount option 'mpol' audit: type=1804 audit(1678045706.065:4): pid=10574 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir2314965326/syzkaller.CMD9dw/59/bus" dev="sda1" ino=14013 res=1 audit: type=1804 audit(1678045706.065:5): pid=10568 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.1" name="/root/syzkaller-testdir2314965326/syzkaller.CMD9dw/59/bus" dev="sda1" ino=14013 res=1 BTRFS info (device loop2): enabling inode map caching BTRFS info (device loop2): force clearing of disk cache BTRFS info (device loop2): disabling free space tree BTRFS info (device loop2): has skinny extents BTRFS info (device loop2): clearing free space tree BTRFS info (device loop2): clearing 1 ro feature flag BTRFS info (device loop2): clearing 2 ro feature flag BTRFS info (device loop2): checking UUID tree BTRFS info (device loop3): enabling inode map caching BTRFS info (device loop3): force clearing of disk cache BTRFS info (device loop3): disabling free space tree BTRFS info (device loop3): has skinny extents BTRFS info (device loop3): clearing free space tree BTRFS info (device loop3): clearing 1 ro feature flag BTRFS info (device loop3): clearing 2 ro feature flag BTRFS info (device loop3): checking UUID tree BTRFS info (device loop3): enabling inode map caching BTRFS info (device loop3): force clearing of disk cache BTRFS info (device loop3): disabling free space tree BTRFS info (device loop3): has skinny extents BTRFS info (device loop3): clearing free space tree BTRFS info (device loop3): clearing 1 ro feature flag BTRFS info (device loop3): clearing 2 ro feature flag BTRFS info (device loop3): checking UUID tree BTRFS info (device loop3): enabling inode map caching BTRFS info (device loop3): force clearing of disk cache BTRFS info (device loop3): disabling free space tree BTRFS info (device loop3): has skinny extents