======================================================== WARNING: possible irq lock inversion dependency detected 5.3.0+ #0 Not tainted -------------------------------------------------------- udevd/3892 just changed the state of lock: ffff88808f19fb58 (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:363 [inline] ffff88808f19fb58 (&(&ctx->ctx_lock)->rlock){..-.}, at: free_ioctx_users+0x33/0x1d0 fs/aio.c:618 but this lock took another, SOFTIRQ-unsafe lock in the past: (&fiq->waitq){+.+.} and interrupts could create inverse lock ordering between them. 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 *** 3 locks held by udevd/3892: #0: ffffffff889b4320 (tomoyo_ss){....}, at: rcu_lock_acquire+0x9/0x40 include/linux/rcupdate.h:207 #1: ffffffff888d3940 (rcu_callback){....}, at: rcu_lock_acquire+0x4/0x30 include/linux/rcupdate.h:207 #2: ffffffff888d38d8 (rcu_read_lock_sched){....}, at: rcu_lock_acquire+0x9/0x40 include/linux/rcupdate.h:207 the shortest dependencies between 2nd lock and 1st lock: -> (&fiq->waitq){+.+.} { HARDIRQ-ON-W at: lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue fs/fuse/dev.c:415 [inline] fuse_request_queue_background+0x673/0xc60 fs/fuse/dev.c:676 fuse_request_send_background+0x56/0x100 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x485/0x660 fs/fuse/cuse.c:519 misc_open+0x3ef/0x440 drivers/char/misc.c:141 chrdev_open+0x509/0x590 fs/char_dev.c:414 do_dentry_open+0x73b/0xf90 fs/open.c:797 vfs_open+0x73/0x80 fs/open.c:906 do_last fs/namei.c:3408 [inline] path_openat+0x1397/0x4460 fs/namei.c:3525 do_filp_open+0x192/0x3d0 fs/namei.c:3555 do_sys_open+0x29f/0x560 fs/open.c:1089 __do_sys_openat fs/open.c:1116 [inline] __se_sys_openat fs/open.c:1110 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1110 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe SOFTIRQ-ON-W at: lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue fs/fuse/dev.c:415 [inline] fuse_request_queue_background+0x673/0xc60 fs/fuse/dev.c:676 fuse_request_send_background+0x56/0x100 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x485/0x660 fs/fuse/cuse.c:519 misc_open+0x3ef/0x440 drivers/char/misc.c:141 chrdev_open+0x509/0x590 fs/char_dev.c:414 do_dentry_open+0x73b/0xf90 fs/open.c:797 vfs_open+0x73/0x80 fs/open.c:906 do_last fs/namei.c:3408 [inline] path_openat+0x1397/0x4460 fs/namei.c:3525 do_filp_open+0x192/0x3d0 fs/namei.c:3555 do_sys_open+0x29f/0x560 fs/open.c:1089 __do_sys_openat fs/open.c:1116 [inline] __se_sys_openat fs/open.c:1110 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1110 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue fs/fuse/dev.c:415 [inline] fuse_request_queue_background+0x673/0xc60 fs/fuse/dev.c:676 fuse_request_send_background+0x56/0x100 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x485/0x660 fs/fuse/cuse.c:519 misc_open+0x3ef/0x440 drivers/char/misc.c:141 chrdev_open+0x509/0x590 fs/char_dev.c:414 do_dentry_open+0x73b/0xf90 fs/open.c:797 vfs_open+0x73/0x80 fs/open.c:906 do_last fs/namei.c:3408 [inline] path_openat+0x1397/0x4460 fs/namei.c:3525 do_filp_open+0x192/0x3d0 fs/namei.c:3555 do_sys_open+0x29f/0x560 fs/open.c:1089 __do_sys_openat fs/open.c:1116 [inline] __se_sys_openat fs/open.c:1110 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1110 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] fuse_iqueue_init.__key+0x0/0x10 ... acquired at: lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] aio_poll fs/aio.c:1751 [inline] __io_submit_one fs/aio.c:1825 [inline] io_submit_one+0x108c/0x1970 fs/aio.c:1862 __do_sys_io_submit fs/aio.c:1921 [inline] __se_sys_io_submit+0x12f/0x240 fs/aio.c:1891 __x64_sys_io_submit+0x7b/0x90 fs/aio.c:1891 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> (&(&ctx->ctx_lock)->rlock){..-.} { IN-SOFTIRQ-W at: lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x6a/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x33/0x1d0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put+0x1c6/0x1d0 include/linux/percpu-refcount.h:309 percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x344/0x420 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x843/0x1050 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x333/0x7c4 arch/x86/include/asm/paravirt.h:766 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x227/0x230 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x113/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 tomoyo_path_matches_pattern+0x50/0x280 security/tomoyo/util.c:918 tomoyo_compare_name_union security/tomoyo/file.c:87 [inline] tomoyo_check_path_acl+0xf2/0x180 security/tomoyo/file.c:260 tomoyo_check_acl+0x133/0x3a0 security/tomoyo/domain.c:172 tomoyo_path_permission security/tomoyo/file.c:586 [inline] tomoyo_path_perm+0x53e/0x850 security/tomoyo/file.c:838 tomoyo_inode_getattr+0x1c/0x20 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xd5/0x150 security/security.c:1182 vfs_getattr+0x2a/0x6d0 fs/stat.c:115 vfs_statx fs/stat.c:191 [inline] vfs_stat include/linux/fs.h:3205 [inline] __do_sys_newstat fs/stat.c:341 [inline] __se_sys_newstat+0x9a/0x150 fs/stat.c:337 __x64_sys_newstat+0x5b/0x70 fs/stat.c:337 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x6a/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] aio_poll fs/aio.c:1749 [inline] __io_submit_one fs/aio.c:1825 [inline] io_submit_one+0x1057/0x1970 fs/aio.c:1862 __do_sys_io_submit fs/aio.c:1921 [inline] __se_sys_io_submit+0x12f/0x240 fs/aio.c:1891 __x64_sys_io_submit+0x7b/0x90 fs/aio.c:1891 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] ioctx_alloc.__key+0x0/0x10 ... acquired at: mark_lock_irq kernel/locking/lockdep.c:3317 [inline] mark_lock+0x46b/0x1650 kernel/locking/lockdep.c:3666 mark_usage kernel/locking/lockdep.c:3566 [inline] __lock_acquire+0x5a0/0x1be0 kernel/locking/lockdep.c:3909 lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x6a/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x33/0x1d0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put+0x1c6/0x1d0 include/linux/percpu-refcount.h:309 percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x344/0x420 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x843/0x1050 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x333/0x7c4 arch/x86/include/asm/paravirt.h:766 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x227/0x230 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x113/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 tomoyo_path_matches_pattern+0x50/0x280 security/tomoyo/util.c:918 tomoyo_compare_name_union security/tomoyo/file.c:87 [inline] tomoyo_check_path_acl+0xf2/0x180 security/tomoyo/file.c:260 tomoyo_check_acl+0x133/0x3a0 security/tomoyo/domain.c:172 tomoyo_path_permission security/tomoyo/file.c:586 [inline] tomoyo_path_perm+0x53e/0x850 security/tomoyo/file.c:838 tomoyo_inode_getattr+0x1c/0x20 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xd5/0x150 security/security.c:1182 vfs_getattr+0x2a/0x6d0 fs/stat.c:115 vfs_statx fs/stat.c:191 [inline] vfs_stat include/linux/fs.h:3205 [inline] __do_sys_newstat fs/stat.c:341 [inline] __se_sys_newstat+0x9a/0x150 fs/stat.c:337 __x64_sys_newstat+0x5b/0x70 fs/stat.c:337 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe stack backtrace: CPU: 1 PID: 3892 Comm: udevd Not tainted 5.3.0+ #0 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+0x1d8/0x2f8 lib/dump_stack.c:113 print_irq_inversion_bug+0x940/0xb80 kernel/locking/lockdep.c:3179 check_usage_forwards+0x144/0x240 kernel/locking/lockdep.c:3204 mark_lock_irq kernel/locking/lockdep.c:3317 [inline] mark_lock+0x46b/0x1650 kernel/locking/lockdep.c:3666 mark_usage kernel/locking/lockdep.c:3566 [inline] __lock_acquire+0x5a0/0x1be0 kernel/locking/lockdep.c:3909 lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x6a/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x33/0x1d0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put+0x1c6/0x1d0 include/linux/percpu-refcount.h:309 percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x344/0x420 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x843/0x1050 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x333/0x7c4 arch/x86/include/asm/paravirt.h:766 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x227/0x230 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x113/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:tomoyo_path_matches_pattern+0x50/0x280 security/tomoyo/util.c:918 Code: 4c 89 e0 48 c1 e8 03 42 80 3c 28 00 74 08 4c 89 e7 e8 14 79 a1 fe 49 8b 04 24 48 89 45 c8 4c 89 f8 48 c1 e8 03 42 80 3c 28 00 <74> 08 4c 89 ff e8 f6 78 a1 fe 49 8b 07 48 89 45 d0 49 8d 7f 0c 48 RSP: 0018:ffff88809689fae8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 1ffff11014c498b3 RBX: 1ffff11012d96074 RCX: ffff8880968901c0 RDX: 0000000000000000 RSI: ffff8880a624c598 RDI: ffff88809689fc18 RBP: ffff88809689fb28 R08: ffffffff830a04ea R09: ffffffff830a1a68 R10: ffff8880968901c0 R11: 0000000000000003 R12: ffff88809689fc18 R13: dffffc0000000000 R14: ffff888096cb03a0 R15: ffff8880a624c598 tomoyo_compare_name_union security/tomoyo/file.c:87 [inline] tomoyo_check_path_acl+0xf2/0x180 security/tomoyo/file.c:260 tomoyo_check_acl+0x133/0x3a0 security/tomoyo/domain.c:172 tomoyo_path_permission security/tomoyo/file.c:586 [inline] tomoyo_path_perm+0x53e/0x850 security/tomoyo/file.c:838 tomoyo_inode_getattr+0x1c/0x20 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xd5/0x150 security/security.c:1182 vfs_getattr+0x2a/0x6d0 fs/stat.c:115 vfs_statx fs/stat.c:191 [inline] vfs_stat include/linux/fs.h:3205 [inline] __do_sys_newstat fs/stat.c:341 [inline] __se_sys_newstat+0x9a/0x150 fs/stat.c:337 __x64_sys_newstat+0x5b/0x70 fs/stat.c:337 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7eff47018c65 Code: 00 00 00 e8 5d 01 00 00 48 83 c4 18 c3 90 90 90 90 90 90 90 90 83 ff 01 48 89 f0 77 18 48 89 c7 48 89 d6 b8 04 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 17 f3 c3 90 48 8b 05 a1 51 2b 00 64 c7 00 16 RSP: 002b:00007ffcd7dd5338 EFLAGS: 00000246 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000c80250 RCX: 00007eff47018c65 RDX: 00007ffcd7dd5350 RSI: 00007ffcd7dd5350 RDI: 00007ffcd7dd57e0 RBP: 00007ffcd7dd5c40 R08: 000000000041f4f1 R09: 00007eff4706f7d0 R10: 7269762f73656369 R11: 0000000000000246 R12: 0000000000000004 R13: 00007ffcd7dd5c47 R14: 0000000000c801b0 R15: 0000000000c80250