===================================================== WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected 5.0.0-rc3-next-20190125 #20 Not tainted ----------------------------------------------------- syz-executor2/15223 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: 00000000b984edd4 (&fiq->waitq){+.+.}, at: spin_lock include/linux/spinlock.h:329 [inline] 00000000b984edd4 (&fiq->waitq){+.+.}, at: aio_poll+0x7b9/0x14e0 fs/aio.c:1772 and this task is already holding: 00000000e71ebd31 (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] 00000000e71ebd31 (&(&ctx->ctx_lock)->rlock){..-.}, at: aio_poll+0x790/0x14e0 fs/aio.c:1771 which would create a new lock dependency: (&(&ctx->ctx_lock)->rlock){..-.} -> (&fiq->waitq){+.+.} but this new dependency connects a SOFTIRQ-irq-safe lock: (&(&ctx->ctx_lock)->rlock){..-.} ... which became SOFTIRQ-irq-safe at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x60/0x80 kernel/locking/spinlock.c:160 spin_lock_irq include/linux/spinlock.h:354 [inline] free_ioctx_users+0xa7/0x6e0 fs/aio.c:610 percpu_ref_put_many include/linux/percpu-refcount.h:285 [inline] percpu_ref_put include/linux/percpu-refcount.h:301 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:123 [inline] percpu_ref_switch_to_atomic_rcu+0x50c/0x6b0 lib/percpu-refcount.c:158 __rcu_reclaim kernel/rcu/rcu.h:240 [inline] rcu_do_batch kernel/rcu/tree.c:2486 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2799 [inline] rcu_core+0xc4a/0x1680 kernel/rcu/tree.c:2780 __do_softirq+0x30b/0xb11 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 update_stack_state+0x3e5/0x680 arch/x86/kernel/unwind_frame.c:208 unwind_next_frame.part.0+0x1ae/0xa90 arch/x86/kernel/unwind_frame.c:329 unwind_next_frame+0x3b/0x50 arch/x86/kernel/unwind_frame.c:287 __save_stack_trace+0x7a/0xf0 arch/x86/kernel/stacktrace.c:44 save_stack_trace+0x1a/0x20 arch/x86/kernel/stacktrace.c:60 save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3609 kmalloc include/linux/slab.h:545 [inline] memcg_schedule_kmem_cache_create mm/memcontrol.c:2511 [inline] memcg_kmem_get_cache+0x373/0x8c0 mm/memcontrol.c:2579 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3367 [inline] kmem_cache_alloc+0x194/0x710 mm/slab.c:3541 sk_prot_alloc+0x67/0x2e0 net/core/sock.c:1497 sk_alloc+0xd7/0x1690 net/core/sock.c:1557 unix_create1+0x1ab/0x650 net/unix/af_unix.c:764 unix_create+0x103/0x1e0 net/unix/af_unix.c:825 __sock_create+0x532/0x930 net/socket.c:1277 sock_create net/socket.c:1317 [inline] __sys_socketpair+0x1f2/0x890 net/socket.c:1405 __do_sys_socketpair net/socket.c:1458 [inline] __se_sys_socketpair net/socket.c:1455 [inline] __x64_sys_socketpair+0x97/0xf0 net/socket.c:1455 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe to a SOFTIRQ-irq-unsafe lock: (&fiq->waitq){+.+.} ... which became SOFTIRQ-irq-unsafe at: ... lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] flush_bg_queue+0x28c/0x570 fs/fuse/dev.c:415 fuse_request_queue_background+0x360/0x640 fs/fuse/dev.c:676 fuse_request_send_background+0x58/0x120 fs/fuse/dev.c:687 fuse_send_init fs/fuse/inode.c:988 [inline] fuse_fill_super+0x1ad8/0x1f00 fs/fuse/inode.c:1213 mount_nodev+0x68/0x110 fs/super.c:1392 fuse_mount+0x2d/0x40 fs/fuse/inode.c:1238 legacy_get_tree+0xf2/0x200 fs/fs_context.c:590 vfs_get_tree+0x123/0x450 fs/super.c:1481 do_new_mount fs/namespace.c:2610 [inline] do_mount+0x1622/0x2fa0 fs/namespace.c:2932 ksys_mount+0xdb/0x150 fs/namespace.c:3148 __do_sys_mount fs/namespace.c:3162 [inline] __se_sys_mount fs/namespace.c:3159 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3159 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&fiq->waitq); local_irq_disable(); lock(&(&ctx->ctx_lock)->rlock); lock(&fiq->waitq); lock(&(&ctx->ctx_lock)->rlock); *** DEADLOCK *** 1 lock held by syz-executor2/15223: #0: 00000000e71ebd31 (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #0: 00000000e71ebd31 (&(&ctx->ctx_lock)->rlock){..-.}, at: aio_poll+0x790/0x14e0 fs/aio.c:1771 the dependencies between SOFTIRQ-irq-safe lock and the holding lock: -> (&(&ctx->ctx_lock)->rlock){..-.} { IN-SOFTIRQ-W at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x60/0x80 kernel/locking/spinlock.c:160 spin_lock_irq include/linux/spinlock.h:354 [inline] free_ioctx_users+0xa7/0x6e0 fs/aio.c:610 percpu_ref_put_many include/linux/percpu-refcount.h:285 [inline] percpu_ref_put include/linux/percpu-refcount.h:301 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:123 [inline] percpu_ref_switch_to_atomic_rcu+0x50c/0x6b0 lib/percpu-refcount.c:158 __rcu_reclaim kernel/rcu/rcu.h:240 [inline] rcu_do_batch kernel/rcu/tree.c:2486 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2799 [inline] rcu_core+0xc4a/0x1680 kernel/rcu/tree.c:2780 __do_softirq+0x30b/0xb11 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 update_stack_state+0x3e5/0x680 arch/x86/kernel/unwind_frame.c:208 unwind_next_frame.part.0+0x1ae/0xa90 arch/x86/kernel/unwind_frame.c:329 unwind_next_frame+0x3b/0x50 arch/x86/kernel/unwind_frame.c:287 __save_stack_trace+0x7a/0xf0 arch/x86/kernel/stacktrace.c:44 save_stack_trace+0x1a/0x20 arch/x86/kernel/stacktrace.c:60 save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3609 kmalloc include/linux/slab.h:545 [inline] memcg_schedule_kmem_cache_create mm/memcontrol.c:2511 [inline] memcg_kmem_get_cache+0x373/0x8c0 mm/memcontrol.c:2579 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3367 [inline] kmem_cache_alloc+0x194/0x710 mm/slab.c:3541 sk_prot_alloc+0x67/0x2e0 net/core/sock.c:1497 sk_alloc+0xd7/0x1690 net/core/sock.c:1557 unix_create1+0x1ab/0x650 net/unix/af_unix.c:764 unix_create+0x103/0x1e0 net/unix/af_unix.c:825 __sock_create+0x532/0x930 net/socket.c:1277 sock_create net/socket.c:1317 [inline] __sys_socketpair+0x1f2/0x890 net/socket.c:1405 __do_sys_socketpair net/socket.c:1458 [inline] __se_sys_socketpair net/socket.c:1455 [inline] __x64_sys_socketpair+0x97/0xf0 net/socket.c:1455 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x60/0x80 kernel/locking/spinlock.c:160 spin_lock_irq include/linux/spinlock.h:354 [inline] free_ioctx_users+0xa7/0x6e0 fs/aio.c:610 percpu_ref_put_many include/linux/percpu-refcount.h:285 [inline] percpu_ref_put include/linux/percpu-refcount.h:301 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:123 [inline] percpu_ref_switch_to_atomic_rcu+0x50c/0x6b0 lib/percpu-refcount.c:158 __rcu_reclaim kernel/rcu/rcu.h:240 [inline] rcu_do_batch kernel/rcu/tree.c:2486 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2799 [inline] rcu_core+0xc4a/0x1680 kernel/rcu/tree.c:2780 __do_softirq+0x30b/0xb11 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 update_stack_state+0x3e5/0x680 arch/x86/kernel/unwind_frame.c:208 unwind_next_frame.part.0+0x1ae/0xa90 arch/x86/kernel/unwind_frame.c:329 unwind_next_frame+0x3b/0x50 arch/x86/kernel/unwind_frame.c:287 __save_stack_trace+0x7a/0xf0 arch/x86/kernel/stacktrace.c:44 save_stack_trace+0x1a/0x20 arch/x86/kernel/stacktrace.c:60 save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3609 kmalloc include/linux/slab.h:545 [inline] memcg_schedule_kmem_cache_create mm/memcontrol.c:2511 [inline] memcg_kmem_get_cache+0x373/0x8c0 mm/memcontrol.c:2579 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3367 [inline] kmem_cache_alloc+0x194/0x710 mm/slab.c:3541 sk_prot_alloc+0x67/0x2e0 net/core/sock.c:1497 sk_alloc+0xd7/0x1690 net/core/sock.c:1557 unix_create1+0x1ab/0x650 net/unix/af_unix.c:764 unix_create+0x103/0x1e0 net/unix/af_unix.c:825 __sock_create+0x532/0x930 net/socket.c:1277 sock_create net/socket.c:1317 [inline] __sys_socketpair+0x1f2/0x890 net/socket.c:1405 __do_sys_socketpair net/socket.c:1458 [inline] __se_sys_socketpair net/socket.c:1455 [inline] __x64_sys_socketpair+0x97/0xf0 net/socket.c:1455 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] __key.52271+0x0/0x40 ... acquired at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] aio_poll+0x7b9/0x14e0 fs/aio.c:1772 __io_submit_one fs/aio.c:1875 [inline] io_submit_one+0xc39/0x1050 fs/aio.c:1908 __do_sys_io_submit fs/aio.c:1953 [inline] __se_sys_io_submit fs/aio.c:1923 [inline] __x64_sys_io_submit+0x1c4/0x5d0 fs/aio.c:1923 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe the dependencies between the lock to be acquired and SOFTIRQ-irq-unsafe lock: -> (&fiq->waitq){+.+.} { HARDIRQ-ON-W at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] flush_bg_queue+0x28c/0x570 fs/fuse/dev.c:415 fuse_request_queue_background+0x360/0x640 fs/fuse/dev.c:676 fuse_request_send_background+0x58/0x120 fs/fuse/dev.c:687 fuse_send_init fs/fuse/inode.c:988 [inline] fuse_fill_super+0x1ad8/0x1f00 fs/fuse/inode.c:1213 mount_nodev+0x68/0x110 fs/super.c:1392 fuse_mount+0x2d/0x40 fs/fuse/inode.c:1238 legacy_get_tree+0xf2/0x200 fs/fs_context.c:590 vfs_get_tree+0x123/0x450 fs/super.c:1481 do_new_mount fs/namespace.c:2610 [inline] do_mount+0x1622/0x2fa0 fs/namespace.c:2932 ksys_mount+0xdb/0x150 fs/namespace.c:3148 __do_sys_mount fs/namespace.c:3162 [inline] __se_sys_mount fs/namespace.c:3159 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3159 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe SOFTIRQ-ON-W at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] flush_bg_queue+0x28c/0x570 fs/fuse/dev.c:415 fuse_request_queue_background+0x360/0x640 fs/fuse/dev.c:676 fuse_request_send_background+0x58/0x120 fs/fuse/dev.c:687 fuse_send_init fs/fuse/inode.c:988 [inline] fuse_fill_super+0x1ad8/0x1f00 fs/fuse/inode.c:1213 mount_nodev+0x68/0x110 fs/super.c:1392 fuse_mount+0x2d/0x40 fs/fuse/inode.c:1238 legacy_get_tree+0xf2/0x200 fs/fs_context.c:590 vfs_get_tree+0x123/0x450 fs/super.c:1481 do_new_mount fs/namespace.c:2610 [inline] do_mount+0x1622/0x2fa0 fs/namespace.c:2932 ksys_mount+0xdb/0x150 fs/namespace.c:3148 __do_sys_mount fs/namespace.c:3162 [inline] __se_sys_mount fs/namespace.c:3159 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3159 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] flush_bg_queue+0x28c/0x570 fs/fuse/dev.c:415 fuse_request_queue_background+0x360/0x640 fs/fuse/dev.c:676 fuse_request_send_background+0x58/0x120 fs/fuse/dev.c:687 fuse_send_init fs/fuse/inode.c:988 [inline] fuse_fill_super+0x1ad8/0x1f00 fs/fuse/inode.c:1213 mount_nodev+0x68/0x110 fs/super.c:1392 fuse_mount+0x2d/0x40 fs/fuse/inode.c:1238 legacy_get_tree+0xf2/0x200 fs/fs_context.c:590 vfs_get_tree+0x123/0x450 fs/super.c:1481 do_new_mount fs/namespace.c:2610 [inline] do_mount+0x1622/0x2fa0 fs/namespace.c:2932 ksys_mount+0xdb/0x150 fs/namespace.c:3148 __do_sys_mount fs/namespace.c:3162 [inline] __se_sys_mount fs/namespace.c:3159 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3159 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] __key.43390+0x0/0x40 ... acquired at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] aio_poll+0x7b9/0x14e0 fs/aio.c:1772 __io_submit_one fs/aio.c:1875 [inline] io_submit_one+0xc39/0x1050 fs/aio.c:1908 __do_sys_io_submit fs/aio.c:1953 [inline] __se_sys_io_submit fs/aio.c:1923 [inline] __x64_sys_io_submit+0x1c4/0x5d0 fs/aio.c:1923 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe stack backtrace: CPU: 1 PID: 15223 Comm: syz-executor2 Not tainted 5.0.0-rc3-next-20190125 #20 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1db/0x2d0 lib/dump_stack.c:113 print_bad_irq_dependency kernel/locking/lockdep.c:1574 [inline] check_usage.cold+0x5e2/0x917 kernel/locking/lockdep.c:1606 check_irq_usage kernel/locking/lockdep.c:1651 [inline] check_prev_add_irq kernel/locking/lockdep_states.h:8 [inline] check_prev_add kernel/locking/lockdep.c:1861 [inline] check_prevs_add kernel/locking/lockdep.c:1969 [inline] validate_chain kernel/locking/lockdep.c:2340 [inline] __lock_acquire+0x2142/0x4a10 kernel/locking/lockdep.c:3321 lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3845 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] aio_poll+0x7b9/0x14e0 fs/aio.c:1772 __io_submit_one fs/aio.c:1875 [inline] io_submit_one+0xc39/0x1050 fs/aio.c:1908 __do_sys_io_submit fs/aio.c:1953 [inline] __se_sys_io_submit fs/aio.c:1923 [inline] __x64_sys_io_submit+0x1c4/0x5d0 fs/aio.c:1923 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458099 Code: 6d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fc0c1748c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458099 RDX: 00000000200008c0 RSI: 0000000000000001 RDI: 00007fc0c1708000 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc0c17496d4 R13: 00000000004bf2cb R14: 00000000004d0af8 R15: 00000000ffffffff