binder: BINDER_SET_CONTEXT_MGR already set binder: 15073:15075 ioctl 40046207 0 returned -16 ====================================================== [ INFO: possible circular locking dependency detected ] 4.4.174+ #17 Not tainted ------------------------------------------------------- syz-executor.4/15084 is trying to acquire lock: (sel_mutex){+.+.+.}, at: [] sel_write_load+0x9e/0xf90 security/selinux/selinuxfs.c:511 but task is already holding lock: (&pipe->mutex/1){+.+.+.}, at: [] pipe_lock_nested fs/pipe.c:65 [inline] (&pipe->mutex/1){+.+.+.}, at: [] pipe_lock+0x63/0x80 fs/pipe.c:73 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&pipe->mutex/1){+.+.+.}: [] 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 [] pipe_lock_nested fs/pipe.c:65 [inline] [] pipe_lock+0x63/0x80 fs/pipe.c:73 [] iter_file_splice_write+0x179/0xb30 fs/splice.c:974 [] do_splice_from fs/splice.c:1128 [inline] [] do_splice fs/splice.c:1404 [inline] [] SYSC_splice fs/splice.c:1707 [inline] [] SyS_splice+0xd71/0x13a0 fs/splice.c:1690 [] 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 -> #4 (sb_writers#4){.+.+.+}: [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] 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 -> #3 (&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 [] entry_SYSCALL_64_fastpath+0x1e/0x9a -> #2 (&ext4_li_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+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 -> #1 (&type->s_umount_key#34){++++++}: [] 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 -> #0 (sel_mutex){+.+.+.}: [] 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_write_load+0x9e/0xf90 security/selinux/selinuxfs.c:511 [] __vfs_write+0x116/0x3d0 fs/read_write.c:491 [] __kernel_write+0x112/0x370 fs/read_write.c:513 [] write_pipe_buf+0x15d/0x1f0 fs/splice.c:1074 [] splice_from_pipe_feed fs/splice.c:776 [inline] [] __splice_from_pipe+0x37e/0x7a0 fs/splice.c:901 [] splice_from_pipe+0x108/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+0xd71/0x13a0 fs/splice.c:1690 [] 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: sel_mutex --> sb_writers#4 --> &pipe->mutex/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pipe->mutex/1); lock(sb_writers#4); lock(&pipe->mutex/1); lock(sel_mutex); *** DEADLOCK *** 2 locks held by syz-executor.4/15084: #0: (sb_writers#3){.+.+.+}, at: [] file_start_write include/linux/fs.h:2543 [inline] #0: (sb_writers#3){.+.+.+}, at: [] do_splice fs/splice.c:1403 [inline] #0: (sb_writers#3){.+.+.+}, at: [] SYSC_splice fs/splice.c:1707 [inline] #0: (sb_writers#3){.+.+.+}, at: [] SyS_splice+0xf2d/0x13a0 fs/splice.c:1690 #1: (&pipe->mutex/1){+.+.+.}, at: [] pipe_lock_nested fs/pipe.c:65 [inline] #1: (&pipe->mutex/1){+.+.+.}, at: [] pipe_lock+0x63/0x80 fs/pipe.c:73 stack backtrace: CPU: 0 PID: 15084 Comm: syz-executor.4 Not tainted 4.4.174+ #17 0000000000000000 b1d8cb0793f51ddb ffff88005d68f4b0 ffffffff81aad1a1 ffffffff84057a80 ffff88006de8af80 ffffffff83ab8870 ffffffff83abd460 ffffffff83abc1d0 ffff88005d68f500 ffffffff813abcda ffffffff83e25b00 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_write_load+0x9e/0xf90 security/selinux/selinuxfs.c:511 [] __vfs_write+0x116/0x3d0 fs/read_write.c:491 [] __kernel_write+0x112/0x370 fs/read_write.c:513 [] write_pipe_buf+0x15d/0x1f0 fs/splice.c:1074 [] splice_from_pipe_feed fs/splice.c:776 [inline] [] __splice_from_pipe+0x37e/0x7a0 fs/splice.c:901 [] splice_from_pipe+0x108/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+0xd71/0x13a0 fs/splice.c:1690 [] 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 SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c binder: 15073:15088 BC_ACQUIRE_DONE u0000000000000000 no match binder: 15073:15088 DecRefs 0 refcount change on invalid ref 0 ret -22 binder: 15073:15088 BC_FREE_BUFFER u0000000000000000 no match binder: 15073:15088 got new transaction with bad transaction stack, transaction 242 has target 14692:0 binder: 15073:15088 transaction failed 29201/-71, size 0-16 line 3041 binder: release 15073:15088 transaction 241 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15073:15088 transaction 244 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15073:15088 transaction 242 out, still active binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c binder: BINDER_SET_CONTEXT_MGR already set binder: 15123:15125 ioctl 40046207 0 returned -16 binder: 15123:15125 BC_ACQUIRE_DONE u0000000000000000 no match binder: 15123:15125 DecRefs 0 refcount change on invalid ref 0 ret -22 binder: 15123:15125 BC_FREE_BUFFER u0000000000000000 no match binder: 15123:15125 got new transaction with bad transaction stack, transaction 246 has target 14692:0 binder: 15123:15125 transaction failed 29201/-71, size 0-16 line 3041 binder: release 15123:15125 transaction 246 out, still active binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 binder: release 15123:15125 transaction 245 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: 15145:15146 ioctl 40046207 0 returned -16 binder: 15145:15146 BC_ACQUIRE_DONE u0000000000000000 no match binder: 15145:15146 DecRefs 0 refcount change on invalid ref 0 ret -22 binder: 15145:15146 BC_FREE_BUFFER u0000000000000000 no match binder: 15145:15146 got new transaction with bad transaction stack, transaction 249 has target 14692:0 binder: 15145:15146 transaction failed 29201/-71, size 0-16 line 3041 binder: release 15145:15146 transaction 248 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15145:15146 transaction 249 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: undelivered TRANSACTION_ERROR: 29201 binder: 15161:15162 ioctl 40046207 0 returned -16 binder: 15161:15162 BC_ACQUIRE_DONE u0000000000000000 no match binder: 15161:15162 DecRefs 0 refcount change on invalid ref 0 ret -22 binder: 15161:15162 BC_FREE_BUFFER u0000000000000000 no match SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c binder: 15161:15162 got new transaction with bad transaction stack, transaction 252 has target 14692:0 binder: 15161:15162 transaction failed 29201/-71, size 0-16 line 3041 binder: release 15161:15162 transaction 252 out, still active binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 binder: release 15161:15162 transaction 251 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: 15176:15180 ioctl 40046207 0 returned -16 binder: 15176:15180 BC_ACQUIRE_DONE u0000000000000000 no match binder: 15176:15180 DecRefs 0 refcount change on invalid ref 0 ret -22 binder: 15176:15180 BC_FREE_BUFFER u0000000000000000 no match binder: 15176:15180 got new transaction with bad transaction stack, transaction 255 has target 14692:0 binder: 15176:15180 transaction failed 29201/-71, size 0-16 line 3041 binder: release 15176:15180 transaction 255 out, still active binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 binder: release 15176:15180 transaction 254 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: 15183:15184 ioctl 40046207 0 returned -16 binder: 15183:15184 BC_ACQUIRE_DONE u0000000000000000 no match binder: 15183:15184 DecRefs 0 refcount change on invalid ref 0 ret -22 binder: 15183:15184 BC_FREE_BUFFER u0000000000000000 no match binder: 15183:15184 got new transaction with bad transaction stack, transaction 258 has target 14692:0 binder: 15183:15184 transaction failed 29201/-71, size 0-16 line 3041 binder: release 15183:15184 transaction 258 out, still active binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29201 binder: release 15183:15184 transaction 257 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: 15197:15198 ioctl 40046207 0 returned -16 binder: release 15197:15198 transaction 260 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: 15204:15205 ioctl 40046207 0 returned -16 binder: release 15204:15205 transaction 261 out, still active binder: undelivered TRANSACTION_COMPLETE SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c binder: BINDER_SET_CONTEXT_MGR already set binder: 15216:15217 ioctl 40046207 0 returned -16 binder: release 15216:15217 transaction 262 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: 15228:15231 ioctl 40046207 0 returned -16 binder: release 15228:15231 transaction 263 out, still active binder: undelivered TRANSACTION_COMPLETE binder: BINDER_SET_CONTEXT_MGR already set binder: 15243:15245 ioctl 40046207 0 returned -16 binder: release 15243:15245 transaction 264 out, still active binder: undelivered TRANSACTION_COMPLETE SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c binder: release 15257:15260 transaction 265 out, still active binder: undelivered TRANSACTION_COMPLETE SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c binder: release 15270:15274 transaction 266 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15332:15333 transaction 267 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15340:15344 transaction 268 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15363:15366 transaction 269 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15378:15381 transaction 270 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15401:15408 transaction 271 out, still active binder: undelivered TRANSACTION_COMPLETE SELinux: policydb magic number 0x30307830 does not match expected magic number 0xf97cff8c binder: release 15421:15423 transaction 272 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15442:15443 transaction 273 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15451:15452 transaction 274 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 15459:15463 transaction 275 out, still active binder: undelivered TRANSACTION_COMPLETE