====================================================== WARNING: possible circular locking dependency detected 4.15.0-rc4-mm1+ #49 Not tainted ------------------------------------------------------ syz-executor2/10544 is trying to acquire lock: (&sig->cred_guard_mutex){+.+.}, at: [<000000005f6a20f3>] proc_pid_attr_write+0x169/0x280 fs/proc/base.c:2570 but task is already holding lock: (&pipe->mutex/1){+.+.}, at: [<000000002ed29d46>] pipe_lock_nested fs/pipe.c:67 [inline] (&pipe->mutex/1){+.+.}, at: [<000000002ed29d46>] pipe_lock+0x56/0x70 fs/pipe.c:75 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&pipe->mutex/1){+.+.}: __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 -> #0 (&sig->cred_guard_mutex){+.+.}: 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_interruptible_nested+0x16/0x20 kernel/locking/mutex.c:930 proc_pid_attr_write+0x169/0x280 fs/proc/base.c:2570 __vfs_write+0xef/0x970 fs/read_write.c:480 __kernel_write+0xf8/0x350 fs/read_write.c:501 write_pipe_buf+0x175/0x220 fs/splice.c:797 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x328/0x730 fs/splice.c:626 splice_from_pipe+0x1e9/0x330 fs/splice.c:661 default_file_splice_write+0x40/0x90 fs/splice.c:809 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x7b7/0x1610 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pipe->mutex/1); lock(&sig->cred_guard_mutex); lock(&pipe->mutex/1); lock(&sig->cred_guard_mutex); *** DEADLOCK *** 2 locks held by syz-executor2/10544: #0: (sb_writers#7){.+.+}, at: [<0000000066f3cc92>] file_start_write include/linux/fs.h:2719 [inline] #0: (sb_writers#7){.+.+}, at: [<0000000066f3cc92>] do_splice fs/splice.c:1146 [inline] #0: (sb_writers#7){.+.+}, at: [<0000000066f3cc92>] SYSC_splice fs/splice.c:1402 [inline] #0: (sb_writers#7){.+.+}, at: [<0000000066f3cc92>] SyS_splice+0x10f6/0x1610 fs/splice.c:1382 #1: (&pipe->mutex/1){+.+.}, at: [<000000002ed29d46>] pipe_lock_nested fs/pipe.c:67 [inline] #1: (&pipe->mutex/1){+.+.}, at: [<000000002ed29d46>] pipe_lock+0x56/0x70 fs/pipe.c:75 stack backtrace: CPU: 0 PID: 10544 Comm: syz-executor2 Not tainted 4.15.0-rc4-mm1+ #49 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_interruptible_nested+0x16/0x20 kernel/locking/mutex.c:930 proc_pid_attr_write+0x169/0x280 fs/proc/base.c:2570 __vfs_write+0xef/0x970 fs/read_write.c:480 __kernel_write+0xf8/0x350 fs/read_write.c:501 write_pipe_buf+0x175/0x220 fs/splice.c:797 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x328/0x730 fs/splice.c:626 splice_from_pipe+0x1e9/0x330 fs/splice.c:661 default_file_splice_write+0x40/0x90 fs/splice.c:809 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x7b7/0x1610 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x452ac9 RSP: 002b:00007f273c247c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007f273c247950 RCX: 0000000000452ac9 RDX: 0000000000000015 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 00007f273c247940 R08: 00000000000009e9 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000004b7434 R13: 00007f273c247ac8 R14: 00000000004b7446 R15: 0000000000000000 kauditd_printk_skb: 211 callbacks suppressed audit: type=1400 audit(1514383431.464:783): avc: denied { prog_load } for pid=10708 comm="syz-executor4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1 FAULT_FLAG_ALLOW_RETRY missing 30 CPU: 0 PID: 10696 Comm: syz-executor7 Not tainted 4.15.0-rc4-mm1+ #49 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 handle_userfault+0xbd9/0x2500 fs/userfaultfd.c:430 do_anonymous_page mm/memory.c:3131 [inline] handle_pte_fault mm/memory.c:3945 [inline] __handle_mm_fault+0x32a3/0x3ce0 mm/memory.c:4071 handle_mm_fault+0x38f/0x930 mm/memory.c:4108 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1429 do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1504 page_fault+0x2c/0x60 arch/x86/entry/entry_64.S:1243 RIP: 0010:fault_in_pages_readable include/linux/pagemap.h:601 [inline] RIP: 0010:iov_iter_fault_in_readable+0x1a7/0x410 lib/iov_iter.c:421 RSP: 0018:ffff8801a9037928 EFLAGS: 00010246 RAX: 0000000000010000 RBX: 0000000020011fd2 RCX: ffffffff8251db91 RDX: 00000000000000c3 RSI: ffffc900036c2000 RDI: ffff8801a9037d28 RBP: ffff8801a9037a08 R08: 1ffff10038200d6a R09: 1ffff10035206f22 R10: ffff8801a9037858 R11: ffffffff87a98008 R12: 1ffff10035206f28 R13: ffff8801a90379e0 R14: 0000000000000000 R15: ffff8801a9037d20 generic_perform_write+0x200/0x600 mm/filemap.c:3128 __generic_file_write_iter+0x366/0x5b0 mm/filemap.c:3263 generic_file_write_iter+0x399/0x790 mm/filemap.c:3291 call_write_iter include/linux/fs.h:1776 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x684/0x970 fs/read_write.c:482 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x452ac9 RSP: 002b:00007f657140ec58 EFLAGS: 00000212 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9 RDX: 000000000000001c RSI: 0000000020011fd2 RDI: 0000000000000014 RBP: 00000000000002f8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f17e0 R13: 00000000ffffffff R14: 00007f657140f6d4 R15: 0000000000000000 QAT: Invalid ioctl QAT: Invalid ioctl audit: type=1400 audit(1514383432.258:784): avc: denied { prog_run } for pid=10791 comm="syz-executor3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1 audit: type=1326 audit(1514383432.428:785): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10824 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452ac9 code=0x7ffc0000 audit: type=1326 audit(1514383432.428:786): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10824 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452ac9 code=0x7ffc0000 audit: type=1326 audit(1514383432.428:787): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10824 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=244 compat=0 ip=0x452ac9 code=0x7ffc0000 audit: type=1326 audit(1514383432.428:788): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10824 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452ac9 code=0x7ffc0000 audit: type=1326 audit(1514383432.429:789): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10824 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452ac9 code=0x7ffc0000 audit: type=1326 audit(1514383432.429:790): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10824 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=9 compat=0 ip=0x452ac9 code=0x7ffc0000 audit: type=1326 audit(1514383432.431:791): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10824 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452ac9 code=0x7ffc0000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 11112 Comm: syz-executor0 Not tainted 4.15.0-rc4-mm1+ #49 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 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:422 [inline] slab_alloc mm/slab.c:3365 [inline] kmem_cache_alloc+0x47/0x760 mm/slab.c:3539 __build_skb+0x9d/0x450 net/core/skbuff.c:281 __napi_alloc_skb+0x173/0x2c0 net/core/skbuff.c:482 napi_alloc_skb include/linux/skbuff.h:2643 [inline] napi_get_frags+0x61/0x130 net/core/dev.c:5058 tun_napi_alloc_frags drivers/net/tun.c:1327 [inline] tun_get_user+0x1cca/0x3900 drivers/net/tun.c:1668 tun_chr_write_iter+0xb9/0x160 drivers/net/tun.c:1836 call_write_iter include/linux/fs.h:1776 [inline] do_iter_readv_writev+0x525/0x7f0 fs/read_write.c:653 do_iter_write+0x154/0x540 fs/read_write.c:932 vfs_writev+0x18a/0x340 fs/read_write.c:977 do_writev+0xfc/0x2a0 fs/read_write.c:1012 SYSC_writev fs/read_write.c:1085 [inline] SyS_writev+0x27/0x30 fs/read_write.c:1082 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x4529a1 RSP: 002b:00007f0efe56eb80 EFLAGS: 00000293 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f0efe56eaa0 RCX: 00000000004529a1 RDX: 0000000000000001 RSI: 00007f0efe56ebd0 RDI: 0000000000000012 RBP: 00007f0efe56ea90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000032 R11: 0000000000000293 R12: 00000000004b767b R13: 00007f0efe56ebc8 R14: 00000000004b767b R15: 0000000000000000 xprt_adjust_timeout: rq_timeout = 0! xprt_adjust_timeout: rq_timeout = 0! device syz3 entered promiscuous mode FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 11347 Comm: syz-executor5 Not tainted 4.15.0-rc4-mm1+ #49 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 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:422 [inline] slab_alloc mm/slab.c:3365 [inline] kmem_cache_alloc+0x47/0x760 mm/slab.c:3539 ptlock_alloc+0x24/0x70 mm/memory.c:4696 ptlock_init include/linux/mm.h:1796 [inline] pgtable_page_ctor include/linux/mm.h:1830 [inline] pte_alloc_one+0x59/0x100 arch/x86/mm/pgtable.c:32 __pte_alloc+0x2a/0x310 mm/memory.c:654 do_anonymous_page mm/memory.c:3109 [inline] handle_pte_fault mm/memory.c:3945 [inline] __handle_mm_fault+0x2d06/0x3ce0 mm/memory.c:4071 handle_mm_fault+0x38f/0x930 mm/memory.c:4108 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1429 do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1504 page_fault+0x2c/0x60 arch/x86/entry/entry_64.S:1243 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x20 arch/x86/lib/copy_user_64.S:180 RSP: 0018:ffff8801ca547d88 EFLAGS: 00010202 RAX: ffffed00394a8fda RBX: 0000000000000078 RCX: 0000000000000078 RDX: 0000000000000078 RSI: ffff8801ca547e58 RDI: 0000000020f72000 RBP: ffff8801ca547db8 R08: ffffed00394a8fda R09: ffffed00394a8fda R10: 000000000000000f R11: ffffed00394a8fd9 R12: 0000000020f72000 R13: ffff8801ca547e58 R14: 00007ffffffff000 R15: 0000000020f72078 copy_to_user include/linux/uaccess.h:155 [inline] copy_msqid_to_user.constprop.9+0x22/0x30 ipc/msg.c:288 SYSC_msgctl+0x212/0x290 ipc/msg.c:565 SyS_msgctl+0x24/0x30 ipc/msg.c:536 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x452ac9 RSP: 002b:00007fa2fb415c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000047 RAX: ffffffffffffffda RBX: 00007fa2fb415aa0 RCX: 0000000000452ac9 RDX: 0000000020f72000 RSI: 000000000000000b RDI: 0000000000000000 RBP: 00007fa2fb415a90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000004b767b R13: 00007fa2fb415bc8 R14: 00000000004b767b R15: 0000000000000000 netlink: 14 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 14 bytes leftover after parsing attributes in process `syz-executor4'. QAT: Invalid ioctl QAT: Invalid ioctl binder: undelivered death notification, 0000000000000000 binder: BINDER_SET_CONTEXT_MGR already set binder: 11619:11635 ioctl 40046207 0 returned -16 binder: undelivered death notification, 0000000000000000 binder_alloc: binder_alloc_mmap_handler: 11648 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 11648:11652 ioctl 40046207 0 returned -16 binder_alloc: 11648: binder_alloc_buf, no vma binder: 11648:11652 transaction failed 29189/-3, size 80-16 line 2960 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 11648:11652 transaction 67 out, still active binder: unexpected work type, 4, not freed binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 67, target dead binder: release 11791:11794 transaction 75 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: invalid inc weak node for 76 binder: 11791:11812 IncRefs 0 refcount change on invalid ref 1 ret -22 binder_alloc: binder_alloc_mmap_handler: 11791 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 11791:11794 ioctl 40046207 0 returned -16 binder_alloc: 11791: binder_alloc_buf, no vma binder: 11791:11823 transaction failed 29189/-3, size 40-8 line 2960 binder: 11791:11794 IncRefs 0 refcount change on invalid ref 1 ret -22 binder: undelivered TRANSACTION_ERROR: 29189 binder: send failed reply for transaction 75, target dead device gre0 entered promiscuous mode device gre0 entered promiscuous mode QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl binder: 12346 RLIMIT_NICE not set binder: 12346 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 12328:12349 ioctl 40046207 0 returned -16 binder: 12347 RLIMIT_NICE not set binder_alloc: 12328: binder_alloc_buf, no vma binder: 12328:12349 transaction failed 29189/-3, size 0-0 line 2960 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 12328:12346 transaction 80 in, still active binder: send failed reply for transaction 80 to 12328:12347 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 device gre0 entered promiscuous mode binder: 12372 RLIMIT_NICE not set binder: 12372 RLIMIT_NICE not set binder: release 12353:12372 transaction 83 in, still active binder: send failed reply for transaction 83 to 12353:12387 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 binder: 12454 RLIMIT_NICE not set binder: 12454 RLIMIT_NICE not set binder: release 12431:12454 transaction 85 in, still active binder: send failed reply for transaction 85 to 12431:12464 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 QAT: Invalid ioctl