====================================================== WARNING: possible circular locking dependency detected 4.20.0+ #396 Not tainted ------------------------------------------------------ syz-executor3/18729 is trying to acquire lock: 0000000050b6cc95 (&ovl_i_mutex_key[depth]){+.+.}, at: inode_lock include/linux/fs.h:757 [inline] 0000000050b6cc95 (&ovl_i_mutex_key[depth]){+.+.}, at: process_measurement+0xc3e/0x1bf0 security/integrity/ima/ima_main.c:207 but task is already holding lock: 000000004ca5f1c8 (&sig->cred_guard_mutex){+.+.}, at: prepare_bprm_creds+0x53/0x120 fs/exec.c:1404 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&sig->cred_guard_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0x166/0x1700 kernel/locking/mutex.c:1072 mutex_lock_killable_nested+0x16/0x20 kernel/locking/mutex.c:1102 lock_trace+0x4c/0xe0 fs/proc/base.c:384 proc_pid_stack+0x1f1/0x430 fs/proc/base.c:434 proc_single_show+0x101/0x190 fs/proc/base.c:737 seq_read+0x4af/0x1150 fs/seq_file.c:229 __vfs_read+0x117/0xa80 fs/read_write.c:416 vfs_read+0x17f/0x3e0 fs/read_write.c:452 ksys_pread64+0x181/0x1b0 fs/read_write.c:626 __do_sys_pread64 fs/read_write.c:636 [inline] __se_sys_pread64 fs/read_write.c:633 [inline] __x64_sys_pread64+0x97/0xf0 fs/read_write.c:633 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #2 (&p->lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0x166/0x1700 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 seq_read+0x71/0x1150 fs/seq_file.c:161 do_loop_readv_writev fs/read_write.c:700 [inline] do_iter_read+0x4bc/0x670 fs/read_write.c:924 vfs_readv+0x175/0x1c0 fs/read_write.c:986 kernel_readv fs/splice.c:362 [inline] default_file_splice_read+0x539/0xb20 fs/splice.c:417 do_splice_to+0x12e/0x190 fs/splice.c:880 splice_direct_to_actor+0x31c/0x9d0 fs/splice.c:957 do_splice_direct+0x2d4/0x420 fs/splice.c:1066 do_sendfile+0x62a/0xe50 fs/read_write.c:1439 __do_sys_sendfile64 fs/read_write.c:1500 [inline] __se_sys_sendfile64 fs/read_write.c:1486 [inline] __x64_sys_sendfile64+0x1fd/0x250 fs/read_write.c:1486 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (sb_writers#3){.+.+}: 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+0x214/0x370 fs/super.c:1387 sb_start_write include/linux/fs.h:1602 [inline] mnt_want_write+0x3f/0xc0 fs/namespace.c:360 ovl_want_write+0x76/0xa0 fs/overlayfs/util.c:24 ovl_xattr_set+0x53/0x5b0 fs/overlayfs/inode.c:332 ovl_posix_acl_xattr_set+0x3c6/0xb00 fs/overlayfs/super.c:908 __vfs_setxattr+0x124/0x180 fs/xattr.c:149 __vfs_setxattr_noperm+0x11d/0x410 fs/xattr.c:180 vfs_setxattr+0xd8/0x100 fs/xattr.c:223 setxattr+0x2ea/0x450 fs/xattr.c:450 path_setxattr+0x1e3/0x230 fs/xattr.c:469 __do_sys_setxattr fs/xattr.c:484 [inline] __se_sys_setxattr fs/xattr.c:480 [inline] __x64_sys_setxattr+0xc4/0x150 fs/xattr.c:480 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&ovl_i_mutex_key[depth]){+.+.}: lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3841 down_write+0x8a/0x130 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:757 [inline] process_measurement+0xc3e/0x1bf0 security/integrity/ima/ima_main.c:207 ima_file_check+0xe5/0x130 security/integrity/ima/ima_main.c:393 do_last fs/namei.c:3422 [inline] path_openat+0x134a/0x5160 fs/namei.c:3534 do_filp_open+0x255/0x380 fs/namei.c:3564 do_open_execat+0x221/0x960 fs/exec.c:853 open_exec+0x53/0x70 fs/exec.c:885 load_misc_binary+0xddd/0x145b fs/binfmt_misc.c:212 search_binary_handler+0x17d/0x570 fs/exec.c:1653 exec_binprm fs/exec.c:1695 [inline] __do_execve_file.isra.34+0x162d/0x2590 fs/exec.c:1819 do_execveat_common fs/exec.c:1866 [inline] do_execveat fs/exec.c:1894 [inline] __do_sys_execveat fs/exec.c:1975 [inline] __se_sys_execveat fs/exec.c:1967 [inline] __x64_sys_execveat+0xed/0x130 fs/exec.c:1967 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: &ovl_i_mutex_key[depth] --> &p->lock --> &sig->cred_guard_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sig->cred_guard_mutex); lock(&p->lock); lock(&sig->cred_guard_mutex); lock(&ovl_i_mutex_key[depth]); *** DEADLOCK *** 1 lock held by syz-executor3/18729: #0: 000000004ca5f1c8 (&sig->cred_guard_mutex){+.+.}, at: prepare_bprm_creds+0x53/0x120 fs/exec.c:1404 stack backtrace: CPU: 0 PID: 18729 Comm: syz-executor3 Not tainted 4.20.0+ #396 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d3/0x2c6 lib/dump_stack.c:113 print_circular_bug.isra.34.cold.56+0x1bd/0x27d kernel/locking/lockdep.c:1224 check_prev_add kernel/locking/lockdep.c:1866 [inline] check_prevs_add kernel/locking/lockdep.c:1979 [inline] validate_chain kernel/locking/lockdep.c:2350 [inline] __lock_acquire+0x3360/0x4c20 kernel/locking/lockdep.c:3338 lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3841 down_write+0x8a/0x130 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:757 [inline] process_measurement+0xc3e/0x1bf0 security/integrity/ima/ima_main.c:207 audit: type=1804 audit(1546134397.406:202): pid=18738 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/57/bus" dev="sda1" ino=17306 res=1 audit: type=1804 audit(1546134397.406:203): pid=18738 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/57/bus" dev="sda1" ino=17306 res=1 ima_file_check+0xe5/0x130 security/integrity/ima/ima_main.c:393 audit: type=1804 audit(1546134397.406:204): pid=18738 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/57/bus" dev="sda1" ino=17306 res=1 do_last fs/namei.c:3422 [inline] path_openat+0x134a/0x5160 fs/namei.c:3534 audit: type=1804 audit(1546134397.406:205): pid=18740 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/57/bus" dev="sda1" ino=17306 res=1 audit: type=1804 audit(1546134397.406:206): pid=18743 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/58/bus" dev="sda1" ino=17303 res=1 audit: type=1804 audit(1546134397.406:207): pid=18745 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/59/bus" dev="sda1" ino=17303 res=1 do_filp_open+0x255/0x380 fs/namei.c:3564 audit: type=1804 audit(1546134397.406:208): pid=18747 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/60/bus" dev="sda1" ino=17303 res=1 do_open_execat+0x221/0x960 fs/exec.c:853 open_exec+0x53/0x70 fs/exec.c:885 load_misc_binary+0xddd/0x145b fs/binfmt_misc.c:212 search_binary_handler+0x17d/0x570 fs/exec.c:1653 exec_binprm fs/exec.c:1695 [inline] __do_execve_file.isra.34+0x162d/0x2590 fs/exec.c:1819 do_execveat_common fs/exec.c:1866 [inline] do_execveat fs/exec.c:1894 [inline] __do_sys_execveat fs/exec.c:1975 [inline] __se_sys_execveat fs/exec.c:1967 [inline] __x64_sys_execveat+0xed/0x130 fs/exec.c:1967 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457ec9 Code: 6d b7 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f3e19e46c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000142 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457ec9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 000000000073bf00 R08: 0000000000001000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3e19e476d4 R13: 00000000004be4bd R14: 00000000004ce6f0 R15: 00000000ffffffff overlayfs: './file0' not a directory audit: type=1804 audit(1546134400.396:209): pid=18769 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/61/bus" dev="sda1" ino=16705 res=1 audit: type=1804 audit(1546134400.426:210): pid=18771 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor5" name="/root/syzkaller-testdir387544332/syzkaller.Ms7iJG/441/bus" dev="sda1" ino=16769 res=1 audit: type=1804 audit(1546134400.536:211): pid=18784 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor5" name="/root/syzkaller-testdir387544332/syzkaller.Ms7iJG/442/bus" dev="sda1" ino=16657 res=1 kauditd_printk_skb: 3 callbacks suppressed audit: type=1804 audit(1546134403.406:215): pid=18807 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor5" name="/root/syzkaller-testdir387544332/syzkaller.Ms7iJG/444/bus" dev="sda1" ino=16669 res=1 net_ratelimit: 1 callbacks suppressed sit: non-ECT from 0.0.0.0 with TOS=0x2 sit: non-ECT from 0.0.0.0 with TOS=0x2 audit: type=1804 audit(1546134403.416:216): pid=18804 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor2" name="/root/syzkaller-testdir224272101/syzkaller.IEOW60/365/bus" dev="sda1" ino=16738 res=1 sit: non-ECT from 0.0.0.0 with TOS=0x2 audit: type=1804 audit(1546134403.446:217): pid=18806 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor4" name="/root/syzkaller-testdir234388736/syzkaller.HziYIs/63/bus" dev="sda1" ino=16670 res=1 audit: type=1804 audit(1546134403.536:218): pid=18820 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor2" name="/root/syzkaller-testdir224272101/syzkaller.IEOW60/366/bus" dev="sda1" ino=16671 res=1 audit: type=1804 audit(1546134403.576:219): pid=18825 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor5" name="/root/syzkaller-testdir387544332/syzkaller.Ms7iJG/445/bus" dev="sda1" ino=16738 res=1 sit: non-ECT from 0.0.0.0 with TOS=0x2 sit: non-ECT from 0.0.0.0 with TOS=0x2 audit: type=1804 audit(1546134406.446:220): pid=18845 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor5" name="/root/syzkaller-testdir387544332/syzkaller.Ms7iJG/446/bus" dev="sda1" ino=16916 res=1 dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) dns_resolver: Unsupported server list version (0) caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect kobject: 'loop0' (000000009f4b2602): kobject_uevent_env kobject: 'loop0' (000000009f4b2602): fill_kobj_path: path = '/devices/virtual/block/loop0' __loop_clr_fd: partition scan of loop0 failed (rc=-22)