====================================================== WARNING: possible circular locking dependency detected 4.15.0-rc4-next-20171221+ #78 Not tainted ------------------------------------------------------ syz-executor1/14269 is trying to acquire lock: (&pipe->mutex/1){+.+.}, at: [<00000000c0252552>] __pipe_lock fs/pipe.c:88 [inline] (&pipe->mutex/1){+.+.}, at: [<00000000c0252552>] fifo_open+0x15c/0xa30 fs/pipe.c:916 but task is already holding lock: (&sig->cred_guard_mutex){+.+.}, at: [<00000000e4b0ce46>] prepare_bprm_creds+0x53/0x110 fs/exec.c:1385 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sig->cred_guard_mutex){+.+.}: __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_personality+0x1c/0xc0 fs/proc/base.c:2899 proc_single_show+0xf8/0x170 fs/proc/base.c:746 seq_read+0x385/0x13d0 fs/seq_file.c:234 do_loop_readv_writev fs/read_write.c:673 [inline] do_iter_read+0x3d2/0x5a0 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+0x10a/0x160 fs/splice.c:880 splice_direct_to_actor+0x242/0x820 fs/splice.c:952 do_splice_direct+0x29b/0x3c0 fs/splice.c:1061 do_sendfile+0x5c9/0xe80 fs/read_write.c:1413 SYSC_sendfile64 fs/read_write.c:1468 [inline] SyS_sendfile64+0xbd/0x160 fs/read_write.c:1460 entry_SYSCALL_64_fastpath+0x1f/0x96 -> #1 (&p->lock){+.+.}: __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+0x3d2/0x5a0 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+0x10a/0x160 fs/splice.c:880 do_splice fs/splice.c:1173 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x1187/0x1610 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 -> #0 (&pipe->mutex/1){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3914 __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/0xa30 fs/pipe.c:916 do_dentry_open+0x667/0xd40 fs/open.c:752 vfs_open+0x107/0x220 fs/open.c:866 do_last fs/namei.c:3397 [inline] path_openat+0x1151/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:1736 do_execve fs/exec.c:1843 [inline] SYSC_execve fs/exec.c:1924 [inline] SyS_execve+0x39/0x50 fs/exec.c:1919 do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285 return_from_SYSCALL_64+0x0/0x75 other info that might help us debug this: Chain exists of: &pipe->mutex/1 --> &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(&pipe->mutex/1); *** DEADLOCK *** 1 lock held by syz-executor1/14269: #0: (&sig->cred_guard_mutex){+.+.}, at: [<00000000e4b0ce46>] prepare_bprm_creds+0x53/0x110 fs/exec.c:1385 stack backtrace: CPU: 0 PID: 14269 Comm: syz-executor1 Not tainted 4.15.0-rc4-next-20171221+ #78 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.isra.37+0x2cd/0x2dc kernel/locking/lockdep.c:1218 check_prev_add kernel/locking/lockdep.c:1858 [inline] check_prevs_add kernel/locking/lockdep.c:1971 [inline] validate_chain kernel/locking/lockdep.c:2412 [inline] __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3426 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3914 __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/0xa30 fs/pipe.c:916 do_dentry_open+0x667/0xd40 fs/open.c:752 vfs_open+0x107/0x220 fs/open.c:866 do_last fs/namei.c:3397 [inline] path_openat+0x1151/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:1736 do_execve fs/exec.c:1843 [inline] SYSC_execve fs/exec.c:1924 [inline] SyS_execve+0x39/0x50 fs/exec.c:1919 do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285 entry_SYSCALL64_slow_path+0x25/0x25 RIP: 0033:0x452ac9 RSP: 002b:00007f8c22fe6c58 EFLAGS: 00000212 ORIG_RAX: 000000000000003b RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9 RDX: 0000000020583fd8 RSI: 0000000020a7bfc8 RDI: 0000000020f8aff8 RBP: 0000000000000066 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006eda30 R13: 00000000ffffffff R14: 00007f8c22fe76d4 R15: 0000000000000000 kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 1 PID: 3218 Comm: udevd Not tainted 4.15.0-rc4-next-20171221+ #78 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:native_write_cr4+0x4/0x10 arch/x86/include/asm/special_insns.h:76 RSP: 0018:ffff8801db307550 EFLAGS: 00010006 RAX: ffff8801ab79e040 RBX: 00000000001606e0 RCX: ffffffff811a47f2 RDX: 0000000000010100 RSI: 0000000000000000 RDI: 00000000001606e0 RBP: ffff8801db307550 R08: 0000000000000006 R09: ffff8801db307710 R10: 000000009a6fbb48 R11: 00000000549f1703 R12: 0000000000000006 R13: ffff8801db31a0f0 R14: ffff8801db31a130 R15: ffff8801db31a130 FS: 00007f478d0b57a0(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f478d0bc000 CR3: 00000001ac7fa003 CR4: 00000000001626e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __write_cr4 arch/x86/include/asm/paravirt.h:76 [inline] __cr4_set arch/x86/include/asm/tlbflush.h:252 [inline] cr4_clear_bits arch/x86/include/asm/tlbflush.h:275 [inline] kvm_cpu_vmxoff arch/x86/kvm/vmx.c:3737 [inline] hardware_disable+0x34a/0x4b0 arch/x86/kvm/vmx.c:3743 kvm_arch_hardware_disable+0x35/0xd0 arch/x86/kvm/x86.c:8110 hardware_disable_nolock+0x30/0x40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3283 flush_smp_call_function_queue+0x1f4/0x570 kernel/smp.c:243 generic_smp_call_function_single_interrupt+0x13/0x30 kernel/smp.c:192 smp_call_function_single_interrupt+0x103/0x640 arch/x86/kernel/smp.c:295 call_function_single_interrupt+0xa9/0xb0 arch/x86/entry/entry_64.S:942 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:777 [inline] RIP: 0010:kmem_cache_free+0x17c/0x2a0 mm/slab.c:3748 RSP: 0018:ffff8801db307950 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff04 RAX: 0000000000000003 RBX: ffff8801d9b30100 RCX: 00000000000508a8 RDX: 0000000000000004 RSI: ffff8801dae23240 RDI: 0000000000000286 RBP: ffff8801db307970 R08: 0000000000000006 R09: ffff8801db307710 R10: 000000009a6fbb48 R11: 00000000549f1703 R12: ffff8801dae23240 R13: 0000000000000286 R14: ffffffff821eaeed R15: ffff8801db307c58 inode_free_rcu+0x1d/0x20 security/selinux/hooks.c:328 __rcu_reclaim kernel/rcu/rcu.h:172 [inline] rcu_do_batch kernel/rcu/tree.c:2675 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2934 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2901 [inline] rcu_process_callbacks+0xd6c/0x17f0 kernel/rcu/tree.c:2918 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 invoke_softirq kernel/softirq.c:365 [inline] irq_exit+0x1cc/0x200 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:540 [inline] smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052 apic_timer_interrupt+0xa9/0xb0 arch/x86/entry/entry_64.S:920 RIP: 0010:lock_acquire+0x276/0x580 kernel/locking/lockdep.c:3903 RSP: 0018:ffff8801ab7a78c0 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff11 RAX: dffffc0000000000 RBX: ffff8801ab79e040 RCX: 0000000000000000 RDX: 1ffffffff0c990a5 RSI: 0000000000000000 RDI: 0000000000000286 RBP: ffff8801ab7a79b8 R08: ffffffff819fc4fc R09: 0000000000000000 R10: ffff8801ab7a78a0 R11: ffff8801cf3abd58 R12: 1ffff100356f4f1e R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000001 down_write+0x87/0x120 kernel/locking/rwsem.c:70 lock_anon_vma_root mm/rmap.c:237 [inline] unlink_anon_vmas+0x2bc/0x9f0 mm/rmap.c:387 free_pgtables+0xe7/0x330 mm/memory.c:627 unmap_region+0x34a/0x4f0 mm/mmap.c:2523 do_munmap+0x726/0xdf0 mm/mmap.c:2737 vm_munmap+0x10b/0x180 mm/mmap.c:2756 SYSC_munmap mm/mmap.c:2766 [inline] SyS_munmap+0x25/0x30 mm/mmap.c:2763 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x7f478c7c5d37 RSP: 002b:00007ffc0098eb18 EFLAGS: 00000206 ORIG_RAX: 000000000000000b RAX: ffffffffffffffda RBX: 0000000000d0a320 RCX: 00007f478c7c5d37 RDX: 0000000000000000 RSI: 0000000000001000 RDI: 00007f478d0bc000 RBP: 0000000000000000 R08: 00007f478d0b57a0 R09: 0000000000000000 R10: 1999999999999999 R11: 0000000000000206 R12: 00000000ffffffff R13: 0000000000d0a320 R14: 0000000000000006 R15: 0000000000000ae8 Code: 0f 1f 80 00 00 00 00 55 48 89 e5 0f 20 d8 5d c3 0f 1f 80 00 00 00 00 55 48 89 e5 0f 22 df 5d c3 0f 1f 80 00 00 00 00 55 48 89 e5 <0f> 22 e7 5d c3 0f 1f 80 00 00 00 00 55 48 89 e5 44 0f 20 c0 5d RIP: native_write_cr4+0x4/0x10 arch/x86/include/asm/special_insns.h:76 RSP: ffff8801db307550 ---[ end trace 30918aa858e78bca ]---