====================================================== WARNING: possible circular locking dependency detected 4.15.0-rc2-mm1+ #39 Not tainted ------------------------------------------------------ syzkaller406451/3206 is trying to acquire lock: (&p->lock){+.+.}, at: [<00000000345e6443>] seq_read+0xd5/0x13d0 fs/seq_file.c:165 but task is already holding lock: (&pipe->mutex/1){+.+.}, at: [<00000000112c390a>] pipe_lock_nested fs/pipe.c:67 [inline] (&pipe->mutex/1){+.+.}, at: [<00000000112c390a>] pipe_lock+0x56/0x70 fs/pipe.c:75 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&pipe->mutex/1){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 __pipe_lock fs/pipe.c:88 [inline] fifo_open+0x15c/0xa40 fs/pipe.c:916 do_dentry_open+0x682/0xd70 fs/open.c:752 vfs_open+0x107/0x230 fs/open.c:866 do_last fs/namei.c:3397 [inline] path_openat+0x1157/0x3530 fs/namei.c:3537 do_filp_open+0x25b/0x3b0 fs/namei.c:3572 do_open_execat+0x1b9/0x5c0 fs/exec.c:849 do_execveat_common.isra.30+0x90c/0x22a0 fs/exec.c:1741 do_execve fs/exec.c:1848 [inline] SYSC_execve fs/exec.c:1929 [inline] SyS_execve+0x39/0x50 fs/exec.c:1924 do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285 return_from_SYSCALL_64+0x0/0x75 -> #1 (&sig->cred_guard_mutex){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_killable_nested+0x16/0x20 kernel/locking/mutex.c:923 lock_trace+0x44/0xc0 fs/proc/base.c:407 proc_pid_stack+0x170/0x340 fs/proc/base.c:443 proc_single_show+0xf8/0x170 fs/proc/base.c:746 seq_read+0x385/0x13d0 fs/seq_file.c:234 __vfs_read+0xef/0xa00 fs/read_write.c:411 vfs_read+0x124/0x360 fs/read_write.c:447 SYSC_read fs/read_write.c:573 [inline] SyS_read+0xef/0x220 fs/read_write.c:566 entry_SYSCALL_64_fastpath+0x1f/0x96 -> #0 (&p->lock){+.+.}: check_prevs_add kernel/locking/lockdep.c:2031 [inline] validate_chain kernel/locking/lockdep.c:2473 [inline] __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 seq_read+0xd5/0x13d0 fs/seq_file.c:165 proc_reg_read+0xef/0x170 fs/proc/inode.c:217 do_loop_readv_writev fs/read_write.c:673 [inline] do_iter_read+0x3db/0x5b0 fs/read_write.c:897 vfs_readv+0x121/0x1c0 fs/read_write.c:959 kernel_readv fs/splice.c:361 [inline] default_file_splice_read+0x508/0xae0 fs/splice.c:416 do_splice_to+0x110/0x170 fs/splice.c:880 do_splice fs/splice.c:1173 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x11a8/0x1630 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 other info that might help us debug this: Chain exists of: &p->lock --> &sig->cred_guard_mutex --> &pipe->mutex/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pipe->mutex/1); lock(&sig->cred_guard_mutex); lock(&pipe->mutex/1); lock(&p->lock); *** DEADLOCK *** 1 lock held by syzkaller406451/3206: #0: (&pipe->mutex/1){+.+.}, at: [<00000000112c390a>] pipe_lock_nested fs/pipe.c:67 [inline] #0: (&pipe->mutex/1){+.+.}, at: [<00000000112c390a>] pipe_lock+0x56/0x70 fs/pipe.c:75 stack backtrace: CPU: 0 PID: 3206 Comm: syzkaller406451 Not tainted 4.15.0-rc2-mm1+ #39 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_circular_bug+0x42d/0x610 kernel/locking/lockdep.c:1271 check_prev_add+0x666/0x15f0 kernel/locking/lockdep.c:1914 check_prevs_add kernel/locking/lockdep.c:2031 [inline] validate_chain kernel/locking/lockdep.c:2473 [inline] __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 seq_read+0xd5/0x13d0 fs/seq_file.c:165 proc_reg_read+0xef/0x170 fs/proc/inode.c:217 do_loop_readv_writev fs/read_write.c:673 [inline] do_iter_read+0x3db/0x5b0 fs/read_write.c:897 vfs_readv+0x121/0x1c0 fs/read_write.c:959 kernel_readv fs/splice.c:361 [inline] default_file_splice_read+0x508/0xae0 fs/splice.c:416 do_splice_to+0x110/0x170 fs/splice.c:880 do_splice fs/splice.c:1173 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x11a8/0x1630 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x4459c9 RSP: 002b:00007fecd1130d28 EFLAGS: 00000212 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007fecd1131700 RCX: 00000000004459c9 RDX: 0000000000000007 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007ffdb8ee6180 R08: 0000000000000082 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 0000000000000000 R13: 00007ffdb8ee617f R14: 00007fecd11319c0 R15: 0000000000000000