====================================================== [ INFO: possible circular locking dependency detected ] 4.4.174+ #17 Not tainted ------------------------------------------------------- syz-executor.1/4497 is trying to acquire lock: (sel_mutex){+.+.+.}, at: [] sel_read_policy+0x59/0x110 security/selinux/selinuxfs.c:441 but task is already holding lock: (sb_writers#4){.+.+.+}, at: [] file_start_write include/linux/fs.h:2543 [inline] (sb_writers#4){.+.+.+}, at: [] do_sendfile+0x8a6/0xba0 fs/read_write.c:1228 which lock already depends on the new lock. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'. audit: type=1400 audit(1575182238.528:21): avc: denied { transfer } for pid=4503 comm="syz-executor.5" 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: 4503:4504 got transaction with invalid handle, 0 binder: 4503:4504 transaction failed 29201/-22, size 88-24 line 3228 binder: BINDER_SET_CONTEXT_MGR already set binder: 4503:4504 ioctl 40046207 0 returned -16 binder_alloc: 4503: binder_alloc_buf, no vma binder: 4503:4505 transaction failed 29189/-3, size 88-24 line 3137 binder: BINDER_SET_CONTEXT_MGR already set binder: 4506:4507 ioctl 40046207 0 returned -16 binder_alloc: 4503: binder_alloc_buf, no vma binder: 4506:4507 transaction failed 29189/-3, size 88-24 line 3137 the existing dependency chain (in reverse order) is: [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [ 121.571369] binder: BINDER_SET_CONTEXT_MGR already set binder: 4508:4509 ioctl 40046207 0 returned -16 binder_alloc: 4503: binder_alloc_buf, no vma binder: 4508:4509 transaction failed 29189/-3, size 88-24 line 3137 [] percpu_down_read include/linux/percpu-rwsem.h:26 [inline] [] __sb_start_write+0x1af/0x310 fs/super.c:1239 [] sb_start_write include/linux/fs.h:1517 [inline] [] ext4_run_li_request fs/ext4/super.c:2685 [inline] [] ext4_lazyinit_thread fs/ext4/super.c:2784 [inline] [] ext4_lazyinit_thread+0x1e4/0x7b0 fs/ext4/super.c:2760 [] kthread+0x273/0x310 kernel/kthread.c:211 [] ret_from_fork+0x55/0x80 arch/x86/entry/entry_64.S:537 binder: 4510:4511 ioctl 40046207 0 returned -16 binder_alloc: 4503: binder_alloc_buf, no vma binder: 4510:4511 transaction failed 29189/-3, size 88-24 line 3137 (&eli->li_list_mtx){+.+...}: [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc1/0xb80 kernel/locking/mutex.c:621 [] ext4_register_li_request+0x2fd/0x7d0 fs/ext4/super.c:2972 [] ext4_remount+0x1366/0x1b90 fs/ext4/super.c:4922 [] do_remount_sb2+0x41b/0x7a0 fs/super.c:781 [] do_remount fs/namespace.c:2347 [inline] [] do_mount+0xfdb/0x2a40 fs/namespace.c:2860 [] SYSC_mount fs/namespace.c:3063 [inline] [] SyS_mount+0x130/0x1d0 fs/namespace.c:3041 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 [] 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+0xc1/0xb80 kernel/locking/mutex.c:621 [] ext4_register_li_request+0x89/0x7d0 fs/ext4/super.c:2945 [] ext4_remount+0x1366/0x1b90 fs/ext4/super.c:4922 [] do_remount_sb2+0x41b/0x7a0 fs/super.c:781 [] do_remount fs/namespace.c:2347 [inline] [] do_mount+0xfdb/0x2a40 fs/namespace.c:2860 [] SYSC_mount fs/namespace.c:3063 [inline] [] SyS_mount+0x130/0x1d0 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/0x250 fs/super.c:547 [] selinux_complete_init+0x2f/0x31 security/selinux/hooks.c:6154 [] security_load_policy+0x69d/0x9c0 security/selinux/ss/services.c:2060 [] sel_write_load+0x175/0xf90 security/selinux/selinuxfs.c:535 [] __vfs_write+0x116/0x3d0 fs/read_write.c:491 [] vfs_write+0x182/0x4e0 fs/read_write.c:540 [] SYSC_write fs/read_write.c:587 [inline] [] SyS_write+0xdc/0x1c0 fs/read_write.c:579 [] entry_SYSCALL_64_fastpath+0x1e/0x9a [] 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+0x37d6/0x4f50 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_nested+0xc1/0xb80 kernel/locking/mutex.c:621 [] sel_read_policy+0x59/0x110 security/selinux/selinuxfs.c:441 [] do_loop_readv_writev+0x148/0x1e0 fs/read_write.c:682 [] do_readv_writev+0x573/0x6e0 fs/read_write.c:812 [] vfs_readv+0x7a/0xb0 fs/read_write.c:836 [] kernel_readv fs/splice.c:586 [inline] [] default_file_splice_read+0x3ac/0x8b0 fs/splice.c:662 [] do_splice_to+0xff/0x160 fs/splice.c:1154 [] splice_direct_to_actor+0x249/0x850 fs/splice.c:1226 [] do_splice_direct+0x1a5/0x260 fs/splice.c:1337 [] do_sendfile+0x4ed/0xba0 fs/read_write.c:1229 [] C_SYSC_sendfile fs/read_write.c:1311 [inline] [] compat_SyS_sendfile+0x144/0x160 fs/read_write.c:1294 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 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(sb_writers#4); lock(&eli->li_list_mtx); lock(sb_writers#4); lock(sel_mutex); *** DEADLOCK *** 1 lock held by syz-executor.1/4497: #0: (sb_writers#4){.+.+.+}, at: [] file_start_write include/linux/fs.h:2543 [inline] #0: (sb_writers#4){.+.+.+}, at: [] do_sendfile+0x8a6/0xba0 fs/read_write.c:1228 stack backtrace: CPU: 0 PID: 4497 Comm: syz-executor.1 Not tainted 4.4.174+ #17 0000000000000000 735ba8f5f3097364 ffff8800ba727020 ffffffff81aad1a1 ffffffff84057a80 ffff8801d74cdf00 ffffffff83ab8a20 ffffffff83abc380 ffffffff83ac8080 ffff8800ba727070 ffffffff813abcda ffffffff83e1ee80 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [] print_circular_bug.cold+0x2f7/0x44e 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+0x37d6/0x4f50 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_nested+0xc1/0xb80 kernel/locking/mutex.c:621 [] sel_read_policy+0x59/0x110 security/selinux/selinuxfs.c:441 [] do_loop_readv_writev+0x148/0x1e0 fs/read_write.c:682 [] do_readv_writev+0x573/0x6e0 fs/read_write.c:812 [] vfs_readv+0x7a/0xb0 fs/read_write.c:836 [] kernel_readv fs/splice.c:586 [inline] [] default_file_splice_read+0x3ac/0x8b0 fs/splice.c:662 [] do_splice_to+0xff/0x160 fs/splice.c:1154 [] splice_direct_to_actor+0x249/0x850 fs/splice.c:1226 [] do_splice_direct+0x1a5/0x260 fs/splice.c:1337 [] do_sendfile+0x4ed/0xba0 fs/read_write.c:1229 [] C_SYSC_sendfile fs/read_write.c:1311 [inline] [] compat_SyS_sendfile+0x144/0x160 fs/read_write.c:1294 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a binder: 4519:4520 got transaction with invalid handle, 0 binder: 4519:4520 transaction failed 29201/-22, size 88-24 line 3228 input: syz1 as /devices/virtual/input/input24 binder: undelivered TRANSACTION_ERROR: 29201 binder: 4529:4534 got transaction with invalid handle, 0 binder: 4532:4535 got transaction with invalid handle, 0 binder: 4532:4535 transaction failed 29201/-22, size 88-24 line 3228 binder: 4529:4534 transaction failed 29201/-22, size 88-24 line 3228 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 binder: 4549:4551 got transaction with invalid handle, 0 binder: 4552:4555 got transaction with invalid handle, 0 binder: 4549:4551 transaction failed 29201/-22, size 88-24 line 3228 binder: 4552:4555 transaction failed 29201/-22, size 88-24 line 3228 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 binder: 4569:4572 got transaction with invalid handle, 0 binder: 4573:4574 got transaction with invalid handle, 0 binder: 4573:4574 transaction failed 29201/-22, size 88-24 line 3228 binder_alloc: 4570: binder_alloc_buf, no vma binder: undelivered TRANSACTION_ERROR: 29201 binder: 4570:4576 transaction failed 29189/-3, size 88-24 line 3137 binder: 4583:4586 got transaction with invalid handle, 0 binder: 4569:4572 transaction failed 29201/-22, size 88-24 line 3228 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 binder: 4583:4586 transaction failed 29201/-22, size 88-24 line 3228 binder: undelivered TRANSACTION_ERROR: 29201 binder: 4596:4599 transaction failed 29189/-22, size 88-24 line 3014 binder: 4598:4602 got transaction with invalid handle, 0 binder: undelivered TRANSACTION_ERROR: 29189 binder: 4598:4602 transaction failed 29201/-22, size 88-24 line 3228 binder: undelivered TRANSACTION_ERROR: 29201 binder: 4610:4613 transaction failed 29189/-22, size 88-24 line 3014 binder: undelivered TRANSACTION_ERROR: 29189 binder: 4637:4646 transaction failed 29189/-22, size 88-24 line 3014 binder: undelivered TRANSACTION_ERROR: 29189 binder: 4754:4758 transaction failed 29189/-22, size 88-24 line 3014 binder: undelivered TRANSACTION_ERROR: 29189 binder: 4772:4778 transaction failed 29189/-22, size 88-24 line 3014 binder: undelivered TRANSACTION_ERROR: 29189 binder: 4789:4791 transaction failed 29189/-22, size 88-24 line 3014 binder: undelivered TRANSACTION_ERROR: 29189 binder: 4839:4840 ioctl c0306201 0 returned -14 binder: 4864:4866 ioctl c0306201 0 returned -14 binder: 4877:4878 ioctl c0306201 0 returned -14 binder_alloc: 4948: binder_alloc_buf, no vma binder: 4948:4955 transaction failed 29189/-3, size 0-24 line 3137 binder: undelivered TRANSACTION_ERROR: 29189 binder_alloc: 4968: binder_alloc_buf, no vma binder: 4968:4972 transaction failed 29189/-3, size 0-0 line 3137 binder: undelivered TRANSACTION_ERROR: 29189