====================================================== WARNING: possible circular locking dependency detected 4.19.0-rc7+ #61 Not tainted ------------------------------------------------------ syz-executor2/20740 is trying to acquire lock: 00000000498e0a93 (&ovl_i_mutex_key[depth]){+.+.}, at: inode_lock include/linux/fs.h:738 [inline] 00000000498e0a93 (&ovl_i_mutex_key[depth]){+.+.}, at: process_measurement+0xc3e/0x1bf0 security/integrity/ima/ima_main.c:205 but task is already holding lock: 00000000c74ce25f (&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 do_loop_readv_writev fs/read_write.c:700 [inline] do_iter_read+0x4a3/0x650 fs/read_write.c:924 vfs_readv+0x175/0x1c0 fs/read_write.c:986 do_preadv+0x1cc/0x280 fs/read_write.c:1070 __do_sys_preadv fs/read_write.c:1120 [inline] __se_sys_preadv fs/read_write.c:1115 [inline] __x64_sys_preadv+0x9a/0xf0 fs/read_write.c:1115 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+0x4a3/0x650 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+0x53c/0xb20 fs/splice.c:417 do_splice_to+0x12e/0x190 fs/splice.c:881 splice_direct_to_actor+0x270/0x8f0 fs/splice.c:953 do_splice_direct+0x2d4/0x420 fs/splice.c:1062 do_sendfile+0x62a/0xe20 fs/read_write.c:1440 __do_sys_sendfile64 fs/read_write.c:1495 [inline] __se_sys_sendfile64 fs/read_write.c:1487 [inline] __x64_sys_sendfile64+0x15d/0x250 fs/read_write.c:1487 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (sb_writers#4){.+.+}: 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:1566 [inline] mnt_want_write+0x3f/0xc0 fs/namespace.c:360 ovl_want_write+0x76/0xa0 fs/overlayfs/util.c:24 ovl_setattr+0x10b/0xaf0 fs/overlayfs/inode.c:30 notify_change+0xbde/0x1110 fs/attr.c:334 do_truncate+0x1bd/0x2d0 fs/open.c:63 handle_truncate fs/namei.c:3008 [inline] do_last fs/namei.c:3424 [inline] path_openat+0x3762/0x5160 fs/namei.c:3534 do_filp_open+0x255/0x380 fs/namei.c:3564 do_sys_open+0x568/0x700 fs/open.c:1063 ksys_open include/linux/syscalls.h:1276 [inline] __do_sys_creat fs/open.c:1121 [inline] __se_sys_creat fs/open.c:1119 [inline] __x64_sys_creat+0x61/0x80 fs/open.c:1119 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:3900 down_write+0x8a/0x130 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:738 [inline] process_measurement+0xc3e/0x1bf0 security/integrity/ima/ima_main.c:205 ima_file_check+0xe5/0x130 security/integrity/ima/ima_main.c:391 do_last fs/namei.c:3422 [inline] path_openat+0x134d/0x5160 fs/namei.c:3534 do_filp_open+0x255/0x380 fs/namei.c:3564 do_open_execat+0x221/0x8e0 fs/exec.c:853 __do_execve_file.isra.33+0x173f/0x2540 fs/exec.c:1755 do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1959 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-executor2/20740: #0: 00000000c74ce25f (&sig->cred_guard_mutex){+.+.}, at: prepare_bprm_creds+0x53/0x120 fs/exec.c:1404 stack backtrace: CPU: 1 PID: 20740 Comm: syz-executor2 Not tainted 4.19.0-rc7+ #61 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+0x1c4/0x2b4 lib/dump_stack.c:113 print_circular_bug.isra.33.cold.54+0x1bd/0x27d kernel/locking/lockdep.c:1221 check_prev_add kernel/locking/lockdep.c:1861 [inline] check_prevs_add kernel/locking/lockdep.c:1974 [inline] validate_chain kernel/locking/lockdep.c:2415 [inline] __lock_acquire+0x33e4/0x4ec0 kernel/locking/lockdep.c:3411 lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3900 down_write+0x8a/0x130 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:738 [inline] process_measurement+0xc3e/0x1bf0 security/integrity/ima/ima_main.c:205 ima_file_check+0xe5/0x130 security/integrity/ima/ima_main.c:391 do_last fs/namei.c:3422 [inline] path_openat+0x134d/0x5160 fs/namei.c:3534 do_filp_open+0x255/0x380 fs/namei.c:3564 do_open_execat+0x221/0x8e0 fs/exec.c:853 __do_execve_file.isra.33+0x173f/0x2540 fs/exec.c:1755 ip6_tunnel: ip6gre1 xmit: Local address not yet configured! ip6_tunnel: ip6gre2 xmit: Local address not yet configured! do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1959 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457569 Code: fd b3 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 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f6d3609bc78 EFLAGS: 00000246 ORIG_RAX: 000000000000003b RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457569 RDX: 0000000020000880 RSI: 0000000020000640 RDI: 0000000020000480 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6d3609c6d4 R13: 00000000004bdbd4 R14: 00000000004cc7d8 R15: 00000000ffffffff audit: type=1804 audit(2000003335.033:1198): pid=20739 uid=0 auid=4294967295 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 op=invalid_pcr cause=open_writers comm="syz-executor3" name="/root/syzkaller-testdir719165905/syzkaller.PvIJNg/1804/bus" dev="sda1" ino=16831 res=1 kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'nullb0' (000000003d4062df): kobject_uevent_env kobject: 'nullb0' (000000003d4062df): fill_kobj_path: path = '/devices/virtual/block/nullb0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env binder: 20857:20861 ioctl 40046205 0 returned -22 kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' binder: 20873:20880 ioctl 40046205 0 returned -22 binder: 20887:20892 ioctl 40046205 0 returned -22 kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env binder: 20898:20901 ioctl 40046205 0 returned -22 kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env binder: 20949:20951 ioctl 40046205 0 returned -22 kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' binder: 20955:20956 ioctl 40046205 0 returned -22 kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' binder: 20960:20961 ioctl 40046205 0 returned -22 kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' binder: 20966:20968 ioctl 40046205 0 returned -22 kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' binder: 20973:20975 ioctl 40046205 0 returned -22 binder: 20982:20983 ioctl 40046205 0 returned -22 kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (00000000a2a8cec8): kobject_uevent_env kobject: 'loop5' (00000000a2a8cec8): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000a34ba7b9): kobject_uevent_env kobject: 'loop0' (00000000a34ba7b9): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop4' (0000000057d11c1c): kobject_uevent_env kobject: 'loop4' (0000000057d11c1c): fill_kobj_path: path = '/devices/virtual/block/loop4'