binder: 25123:25136 ioctl c0306201 20000440 returned -22 ====================================================== [ INFO: possible circular locking dependency detected ] 4.4.169+ #7 Not tainted ------------------------------------------------------- syz-executor0/25138 is trying to acquire lock: (&sig->cred_guard_mutex){+.+.+.}, at: [] lock_trace+0x44/0xc0 fs/proc/base.c:448 but task is already holding lock: (&p->lock){+.+.+.}, at: [] seq_read+0xdd/0x12b0 fs/seq_file.c:178 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc2/0xb60 kernel/locking/mutex.c:621 binder_alloc: binder_alloc_mmap_handler: 25123 20001000-20004000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 25123:25136 ioctl 40046207 0 returned -16 binder: 25123:25145 unknown command 0 binder: 25123:25145 ioctl c0306201 20000440 returned -22 [] seq_read+0xdd/0x12b0 fs/seq_file.c:178 [] do_loop_readv_writev+0x148/0x1e0 fs/read_write.c:680 [] do_readv_writev+0x581/0x6f0 fs/read_write.c:810 [] vfs_readv+0x78/0xb0 fs/read_write.c:834 [] kernel_readv fs/splice.c:586 [inline] [] default_file_splice_read+0x50f/0x8f0 fs/splice.c:662 [] do_splice_to+0xf7/0x140 fs/splice.c:1154 [] splice_direct_to_actor+0x242/0x830 fs/splice.c:1226 [] do_splice_direct+0x1a3/0x270 fs/splice.c:1337 [] do_sendfile+0x4e4/0xb80 fs/read_write.c:1227 [] C_SYSC_sendfile fs/read_write.c:1303 [inline] [] compat_SyS_sendfile+0xd1/0x160 fs/read_write.c:1292 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x321/0xa80 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] percpu_down_read include/linux/percpu-rwsem.h:26 [inline] [] __sb_start_write+0x1ae/0x310 fs/super.c:1221 [] sb_start_write include/linux/fs.h:1517 [inline] [] ext4_run_li_request fs/ext4/super.c:2674 [inline] [] ext4_lazyinit_thread+0x1a7/0x750 fs/ext4/super.c:2773 [] kthread+0x268/0x300 kernel/kthread.c:211 [] ret_from_fork+0x55/0x80 arch/x86/entry/entry_64.S:537 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc2/0xb60 kernel/locking/mutex.c:621 [] ext4_register_li_request+0x304/0x7a0 fs/ext4/super.c:2961 [] ext4_remount+0x1368/0x1bb0 fs/ext4/super.c:4911 [] do_remount_sb2+0x428/0x7d0 fs/super.c:771 [] do_remount fs/namespace.c:2347 [inline] [] do_mount+0x101e/0x2a10 fs/namespace.c:2860 [] SYSC_mount fs/namespace.c:3063 [inline] [] SyS_mount+0x191/0x1c0 fs/namespace.c:3041 [] entry_SYSCALL_64_fastpath+0x1e/0x9a [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc2/0xb60 kernel/locking/mutex.c:621 [] ext4_register_li_request+0x87/0x7a0 fs/ext4/super.c:2934 [] ext4_remount+0x1368/0x1bb0 fs/ext4/super.c:4911 [] do_remount_sb2+0x428/0x7d0 fs/super.c:771 [] do_remount fs/namespace.c:2347 [inline] [] do_mount+0x101e/0x2a10 fs/namespace.c:2860 [] SYSC_mount fs/namespace.c:3063 [inline] [] SyS_mount+0x191/0x1c0 fs/namespace.c:3041 [] entry_SYSCALL_64_fastpath+0x1e/0x9a [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] down_read+0x42/0x60 kernel/locking/rwsem.c:22 [] iterate_supers+0xe1/0x260 fs/super.c:537 [] selinux_complete_init+0x2f/0x31 security/selinux/hooks.c:6154 [] security_load_policy+0x886/0x9b0 security/selinux/ss/services.c:2060 [] sel_write_load+0x191/0xfc0 security/selinux/selinuxfs.c:535 [] __vfs_write+0x11c/0x3e0 fs/read_write.c:489 [] vfs_write+0x17e/0x4e0 fs/read_write.c:538 [] SYSC_write fs/read_write.c:585 [inline] [] SyS_write+0xd9/0x1c0 fs/read_write.c:577 [] entry_SYSCALL_64_fastpath+0x1e/0x9a [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc2/0xb60 kernel/locking/mutex.c:621 [] sel_commit_bools_write+0x87/0x250 security/selinux/selinuxfs.c:1142 [] __vfs_write+0x11c/0x3e0 fs/read_write.c:489 [] __kernel_write+0x10a/0x350 fs/read_write.c:511 [] write_pipe_buf+0x15d/0x1f0 fs/splice.c:1074 [] splice_from_pipe_feed fs/splice.c:776 [inline] [] __splice_from_pipe+0x364/0x790 fs/splice.c:901 [] splice_from_pipe+0xf9/0x170 fs/splice.c:936 [] default_file_splice_write+0x3c/0x80 fs/splice.c:1086 [] do_splice_from fs/splice.c:1128 [inline] [] do_splice fs/splice.c:1404 [inline] [] SYSC_splice fs/splice.c:1707 [inline] [] SyS_splice+0xde1/0x1430 fs/splice.c:1690 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x321/0xa80 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc2/0xb60 kernel/locking/mutex.c:621 [] __pipe_lock fs/pipe.c:86 [inline] [] fifo_open+0x15c/0x9e0 fs/pipe.c:896 [] do_dentry_open+0x38d/0xbd0 fs/open.c:749 [] vfs_open+0x12a/0x210 fs/open.c:862 [] do_last fs/namei.c:3269 [inline] [] path_openat+0xc10/0x3f10 fs/namei.c:3406 [] do_filp_open+0x197/0x270 fs/namei.c:3440 [] do_open_execat+0x10f/0x6f0 fs/exec.c:805 [] do_execveat_common.isra.14+0x6a1/0x1f00 fs/exec.c:1577 [] compat_do_execve fs/exec.c:1710 [inline] [] C_SYSC_execve fs/exec.c:1785 [inline] [] compat_SyS_execve+0x48/0x60 fs/exec.c:1781 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x321/0xa80 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x3cd4/0x5530 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_killable_nested+0xd2/0xce0 kernel/locking/mutex.c:641 [] lock_trace+0x44/0xc0 fs/proc/base.c:448 [ 667.006587] audit: type=1400 audit(1545983209.656:2833): avc: denied { set_context_mgr } for pid=25153 comm="syz-executor2" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=binder permissive=1 binder: 25153:25154 unknown command 0 binder: 25153:25154 ioctl c0306201 20000440 returned -22 [] proc_pid_syscall+0xa9/0x260 fs/proc/base.c:683 [] proc_single_show+0xfd/0x170 fs/proc/base.c:805 [] seq_read+0x4b6/0x12b0 fs/seq_file.c:240 [] do_loop_readv_writev+0x148/0x1e0 fs/read_write.c:680 [] compat_do_readv_writev+0x583/0x6f0 fs/read_write.c:984 [] compat_readv+0xde/0x150 fs/read_write.c:1013 [] C_SYSC_readv fs/read_write.c:1033 [inline] [] compat_SyS_readv+0xd8/0x1c0 fs/read_write.c:1022 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x321/0xa80 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a other info that might help us debug this: Chain exists of: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&p->lock); lock(sb_writers#4); lock(&p->lock); lock(&sig->cred_guard_mutex); *** DEADLOCK *** 2 locks held by syz-executor0/25138: #0: (&f->f_pos_lock){+.+.+.}, at: [] __fdget_pos+0xac/0xd0 fs/file.c:780 #1: (&p->lock){+.+.+.}, at: [] seq_read+0xdd/0x12b0 fs/seq_file.c:178 stack backtrace: CPU: 1 PID: 25138 Comm: syz-executor0 Not tainted 4.4.169+ #7 0000000000000000 c45aeffc0018b81c ffff8801d29d7460 ffffffff81aa635d ffffffff83ab8380 ffffffff83ab2860 ffff8800b3c3df00 ffffffff83ab4000 ffff8800b3c3e810 ffff8801d29d74b0 ffffffff813a9589 ffff8800b3c3df00 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_circular_bug.cold.31+0x2f6/0x435 kernel/locking/lockdep.c:1226 [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x3cd4/0x5530 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_killable_nested+0xd2/0xce0 kernel/locking/mutex.c:641 audit: type=1400 audit(1545983209.656:2834): avc: denied { create } for pid=25161 comm="syz-executor2" 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 audit: type=1400 audit(1545983209.656:2835): avc: denied { write } for pid=25161 comm="syz-executor2" 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 audit: type=1400 audit(1545983209.656:2836): avc: denied { getattr } for pid=25161 comm="syz-executor2" path="socket:[73103]" dev="sockfs" ino=73103 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 [] lock_trace+0x44/0xc0 fs/proc/base.c:448 [] proc_pid_syscall+0xa9/0x260 fs/proc/base.c:683 [] proc_single_show+0xfd/0x170 fs/proc/base.c:805 [] seq_read+0x4b6/0x12b0 fs/seq_file.c:240 [] do_loop_readv_writev+0x148/0x1e0 fs/read_write.c:680 [] compat_do_readv_writev+0x583/0x6f0 fs/read_write.c:984 [] compat_readv+0xde/0x150 fs/read_write.c:1013 [] C_SYSC_readv fs/read_write.c:1033 [inline] [] compat_SyS_readv+0xd8/0x1c0 fs/read_write.c:1022 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x321/0xa80 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a audit: type=1400 audit(1545983211.416:2837): avc: denied { create } for pid=25161 comm="syz-executor2" 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 audit: type=1400 audit(1545983211.456:2838): avc: denied { write } for pid=25161 comm="syz-executor2" 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 audit: type=1400 audit(1545983216.806:2839): avc: denied { create } for pid=25376 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983216.966:2840): avc: denied { write } for pid=25376 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983217.046:2841): avc: denied { read } for pid=25376 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983217.076:2842): avc: denied { create } for pid=25376 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983217.546:2843): avc: denied { create } for pid=25404 comm="syz-executor0" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983217.636:2844): avc: denied { write } for pid=25404 comm="syz-executor0" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983217.906:2845): avc: denied { read } for pid=25404 comm="syz-executor0" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983218.026:2846): avc: denied { create } for pid=25428 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=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983218.156:2847): avc: denied { create } for pid=25439 comm="syz-executor0" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1545983218.316:2848): avc: denied { write } for pid=25439 comm="syz-executor0" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1