====================================================== WARNING: possible circular locking dependency detected 4.14.68+ #4 Not tainted ------------------------------------------------------ syz-executor4/9101 is trying to acquire lock: (&p->lock){+.+.}, at: [] seq_read+0xd4/0x11d0 fs/seq_file.c:165 but task is already holding lock: (&sig->cred_guard_mutex){+.+.}, at: [] prepare_bprm_creds+0x4e/0x110 fs/exec.c:1389 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sig->cred_guard_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xf5/0x1480 kernel/locking/mutex.c:893 lock_trace+0x3f/0xc0 fs/proc/base.c:408 proc_pid_stack+0xcd/0x200 fs/proc/base.c:444 proc_single_show+0xf1/0x160 fs/proc/base.c:748 seq_read+0x4e0/0x11d0 fs/seq_file.c:237 do_loop_readv_writev fs/read_write.c:698 [inline] do_iter_read+0x3cc/0x580 fs/read_write.c:922 vfs_readv+0xe6/0x150 fs/read_write.c:984 do_preadv+0x187/0x230 fs/read_write.c:1068 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #0 (&p->lock){+.+.}: lock_acquire+0x10f/0x380 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xf5/0x1480 kernel/locking/mutex.c:893 seq_read+0xd4/0x11d0 fs/seq_file.c:165 __vfs_read+0xf4/0x5b0 fs/read_write.c:411 vfs_read+0x11e/0x330 fs/read_write.c:447 kernel_read+0xa6/0x110 fs/read_write.c:426 prepare_binprm+0x5da/0x810 fs/exec.c:1566 do_execveat_common.isra.14+0xe91/0x1d60 fs/exec.c:1783 do_execveat fs/exec.c:1858 [inline] SYSC_execveat fs/exec.c:1939 [inline] SyS_execveat+0x49/0x60 fs/exec.c:1931 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sig->cred_guard_mutex); lock(&p->lock); lock(&sig->cred_guard_mutex); lock(&p->lock); *** DEADLOCK *** 1 lock held by syz-executor4/9101: #0: (&sig->cred_guard_mutex){+.+.}, at: [] prepare_bprm_creds+0x4e/0x110 fs/exec.c:1389 stack backtrace: CPU: 1 PID: 9101 Comm: syz-executor4 Not tainted 4.14.68+ #4 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x11b lib/dump_stack.c:53 print_circular_bug.isra.18.cold.43+0x2d3/0x40c kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2ff9/0x4320 kernel/locking/lockdep.c:3487 lock_acquire+0x10f/0x380 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xf5/0x1480 kernel/locking/mutex.c:893 seq_read+0xd4/0x11d0 fs/seq_file.c:165 __vfs_read+0xf4/0x5b0 fs/read_write.c:411 vfs_read+0x11e/0x330 fs/read_write.c:447 kernel_read+0xa6/0x110 fs/read_write.c:426 prepare_binprm+0x5da/0x810 fs/exec.c:1566 do_execveat_common.isra.14+0xe91/0x1d60 fs/exec.c:1783 do_execveat fs/exec.c:1858 [inline] SYSC_execveat fs/exec.c:1939 [inline] SyS_execveat+0x49/0x60 fs/exec.c:1931 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x457099 RSP: 002b:00007f4195f43c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000142 RAX: ffffffffffffffda RBX: 00007f4195f446d4 RCX: 0000000000457099 RDX: 00000000200001c0 RSI: 0000000020000000 RDI: 0000000000000007 RBP: 00000000009300a0 R08: 0000000000001000 R09: 0000000000000000 R10: 0000000020000640 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004cbe90 R14: 00000000004c35bc R15: 0000000000000000 input:  as /devices/virtual/input/input110 input:  as /devices/virtual/input/input111 audit: type=1400 audit(2000000021.839:322): avc: denied { map } for pid=9178 comm="syz-executor1" path="socket:[87654]" dev="sockfs" ino=87654 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=tcp_socket permissive=1 ip6_tunnel:  xmit: Local address not yet configured! SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=9226 comm=syz-executor2 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=9226 comm=syz-executor2 binder: 9296:9298 transaction failed 29189/-22, size 0-0 line 3012 binder: 9296:9298 ioctl c0306201 20008fd0 returned -14 binder_alloc: 9296: binder_alloc_buf, no vma binder: 9296:9297 transaction failed 29189/-3, size 0-0 line 3135 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: 9352:9353 BC_INCREFS_DONE u0000000020ffc000 no match binder: 9352:9353 got transaction to context manager from process owning it binder: 9352:9353 transaction failed 29201/-22, size 0-0 line 3003 binder: undelivered TRANSACTION_ERROR: 29201 binder: 9365:9367 ioctl 80087601 20000580 returned -22 binder_alloc: binder_alloc_mmap_handler: 9365 20001000-20004000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: 9365: binder_alloc_buf, no vma binder: 9365:9367 ioctl 40046207 0 returned -16 binder: 9365:9377 transaction failed 29189/-3, size 0-0 line 3135 binder: 9365:9382 ioctl 80087601 20000580 returned -22 binder: undelivered TRANSACTION_ERROR: 29189 binder: send failed reply for transaction 153 to 9365:9367 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 f2fs_msg: 2 callbacks suppressed F2FS-fs (loop3): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop3): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop3): Unrecognized mount option "" or missing value F2FS-fs (loop3): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop3): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop3): Unrecognized mount option "" or missing value loop7: p1 < > p4 loop7: p1 size 2 extends beyond EOD, truncated loop7: p4 start 1854537728 is beyond EOD, truncated loop7: p1 < > p4 loop7: p1 size 2 extends beyond EOD, truncated loop7: p4 start 1854537728 is beyond EOD, truncated audit: type=1400 audit(2000000026.369:323): avc: denied { setattr } for pid=9624 comm="syz-executor1" name="NETLINK" dev="sockfs" ino=89138 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 binder: 9712:9714 IncRefs 0 refcount change on invalid ref 118030336 ret -22 binder: 9712:9714 unknown command 2111842130 binder: 9712:9714 ioctl c0306201 20000140 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 9712:9725 ioctl 40046207 0 returned -16 binder: 9712:9714 IncRefs 0 refcount change on invalid ref 118030336 ret -22 binder: 9712:9714 unknown command 2111842130 binder: 9712:9714 ioctl c0306201 20000140 returned -22 futex_wake_op: syz-executor1 tries to shift op by 4095; fix this program futex_wake_op: syz-executor1 tries to shift op by 4095; fix this program netlink: 12 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor1'.