======================================================== WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- udevd/5451 just changed the state of lock: ffff888029872110 (&group->lock#2){..-.}-{2:2}, at: class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] ffff888029872110 (&group->lock#2){..-.}-{2:2}, at: snd_pcm_period_elapsed+0x21/0x50 sound/core/pcm_lib.c:1904 but this lock took another, SOFTIRQ-unsafe lock in the past: (&timer->lock){+.+.}-{2:2} 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(&timer->lock); local_irq_disable(); lock(&group->lock#2); lock(&timer->lock); lock(&group->lock#2); *** DEADLOCK *** 1 lock held by udevd/5451: #0: ffffffff8e79d8b0 (tomoyo_ss){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:116 [inline] #0: ffffffff8e79d8b0 (tomoyo_ss){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:215 [inline] #0: ffffffff8e79d8b0 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_read_lock security/tomoyo/common.h:1108 [inline] #0: ffffffff8e79d8b0 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_check_open_permission+0x204/0x500 security/tomoyo/file.c:767 the shortest dependencies between 2nd lock and 1st lock: -> (&timer->lock){+.+.}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:561 [inline] snd_timer_close_locked+0x53/0x8d0 sound/core/timer.c:412 snd_timer_close+0xae/0x130 sound/core/timer.c:464 snd_seq_timer_close+0xa9/0xe0 sound/core/seq/seq_timer.c:302 queue_delete sound/core/seq/seq_queue.c:126 [inline] snd_seq_queue_delete+0x8f/0xf0 sound/core/seq/seq_queue.c:188 delete_seq_queue sound/core/seq/oss/seq_oss_init.c:371 [inline] snd_seq_oss_release+0x1d3/0x310 sound/core/seq/oss/seq_oss_init.c:416 odev_release+0x56/0x80 sound/core/seq/oss/seq_oss.c:144 __fput+0x429/0x8a0 fs/file_table.c:422 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1541 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 SOFTIRQ-ON-W at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:561 [inline] snd_timer_close_locked+0x53/0x8d0 sound/core/timer.c:412 snd_timer_close+0xae/0x130 sound/core/timer.c:464 snd_seq_timer_close+0xa9/0xe0 sound/core/seq/seq_timer.c:302 queue_delete sound/core/seq/seq_queue.c:126 [inline] snd_seq_queue_delete+0x8f/0xf0 sound/core/seq/seq_queue.c:188 delete_seq_queue sound/core/seq/oss/seq_oss_init.c:371 [inline] snd_seq_oss_release+0x1d3/0x310 sound/core/seq/oss/seq_oss_init.c:416 odev_release+0x56/0x80 sound/core/seq/oss/seq_oss.c:144 __fput+0x429/0x8a0 fs/file_table.c:422 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1541 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 INITIAL USE at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 class_spinlock_irqsave_constructor include/linux/spinlock.h:574 [inline] snd_timer_notify+0x103/0x3d0 sound/core/timer.c:1040 snd_pcm_action sound/core/pcm_native.c:1370 [inline] snd_pcm_action_lock_irq+0x1b5/0x290 sound/core/pcm_native.c:1383 snd_pcm_oss_set_trigger+0x580/0x730 sound/core/oss/pcm_oss.c:2134 snd_pcm_oss_poll+0x668/0x8c0 sound/core/oss/pcm_oss.c:2863 vfs_poll include/linux/poll.h:84 [inline] ep_item_poll fs/eventpoll.c:995 [inline] ep_insert+0x10c4/0x1900 fs/eventpoll.c:1666 do_epoll_ctl+0x8d2/0xf70 fs/eventpoll.c:2329 __do_sys_epoll_ctl fs/eventpoll.c:2386 [inline] __se_sys_epoll_ctl fs/eventpoll.c:2377 [inline] __x64_sys_epoll_ctl+0x161/0x1a0 fs/eventpoll.c:2377 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 } ... key at: [] snd_timer_new.__key+0x0/0x20 ... acquired at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 class_spinlock_irqsave_constructor include/linux/spinlock.h:574 [inline] snd_timer_notify+0x103/0x3d0 sound/core/timer.c:1040 snd_pcm_action sound/core/pcm_native.c:1370 [inline] snd_pcm_action_lock_irq+0x1b5/0x290 sound/core/pcm_native.c:1383 snd_pcm_oss_set_trigger+0x580/0x730 sound/core/oss/pcm_oss.c:2134 snd_pcm_oss_poll+0x668/0x8c0 sound/core/oss/pcm_oss.c:2863 vfs_poll include/linux/poll.h:84 [inline] ep_item_poll fs/eventpoll.c:995 [inline] ep_insert+0x10c4/0x1900 fs/eventpoll.c:1666 do_epoll_ctl+0x8d2/0xf70 fs/eventpoll.c:2329 __do_sys_epoll_ctl fs/eventpoll.c:2386 [inline] __se_sys_epoll_ctl fs/eventpoll.c:2377 [inline] __x64_sys_epoll_ctl+0x161/0x1a0 fs/eventpoll.c:2377 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 -> (&group->lock#2){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] snd_pcm_period_elapsed+0x21/0x50 sound/core/pcm_lib.c:1904 dummy_hrtimer_callback+0x7f/0x180 sound/drivers/dummy.c:385 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x595/0xd00 kernel/time/hrtimer.c:1756 hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1773 __do_softirq+0x2bc/0x943 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 variable_test_bit arch/x86/include/asm/bitops.h:227 [inline] arch_test_bit arch/x86/include/asm/bitops.h:239 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] tomoyo_check_acl+0x2d8/0x3f0 security/tomoyo/domain.c:184 tomoyo_path_permission+0x1af/0x360 security/tomoyo/file.c:586 tomoyo_check_open_permission+0x479/0x500 security/tomoyo/file.c:780 security_file_open+0x69/0x570 security/security.c:2955 do_dentry_open+0x327/0x15a0 fs/open.c:942 do_open fs/namei.c:3642 [inline] path_openat+0x2860/0x3240 fs/namei.c:3799 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 INITIAL USE at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:170 class_pcm_stream_lock_irq_constructor include/sound/pcm.h:666 [inline] snd_pcm_oss_poll+0x191/0x8c0 sound/core/oss/pcm_oss.c:2841 vfs_poll include/linux/poll.h:84 [inline] ep_item_poll fs/eventpoll.c:995 [inline] ep_insert+0x10c4/0x1900 fs/eventpoll.c:1666 do_epoll_ctl+0x8d2/0xf70 fs/eventpoll.c:2329 __do_sys_epoll_ctl fs/eventpoll.c:2386 [inline] __se_sys_epoll_ctl fs/eventpoll.c:2377 [inline] __x64_sys_epoll_ctl+0x161/0x1a0 fs/eventpoll.c:2377 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 } ... key at: [] snd_pcm_group_init.__key+0x0/0x20 ... acquired at: mark_lock+0x223/0x350 kernel/locking/lockdep.c:4678 __lock_acquire+0xbcd/0x1fd0 kernel/locking/lockdep.c:5091 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] snd_pcm_period_elapsed+0x21/0x50 sound/core/pcm_lib.c:1904 dummy_hrtimer_callback+0x7f/0x180 sound/drivers/dummy.c:385 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x595/0xd00 kernel/time/hrtimer.c:1756 hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1773 __do_softirq+0x2bc/0x943 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 variable_test_bit arch/x86/include/asm/bitops.h:227 [inline] arch_test_bit arch/x86/include/asm/bitops.h:239 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] tomoyo_check_acl+0x2d8/0x3f0 security/tomoyo/domain.c:184 tomoyo_path_permission+0x1af/0x360 security/tomoyo/file.c:586 tomoyo_check_open_permission+0x479/0x500 security/tomoyo/file.c:780 security_file_open+0x69/0x570 security/security.c:2955 do_dentry_open+0x327/0x15a0 fs/open.c:942 do_open fs/namei.c:3642 [inline] path_openat+0x2860/0x3240 fs/namei.c:3799 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 stack backtrace: CPU: 0 PID: 5451 Comm: udevd Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 mark_lock_irq+0x80c/0xc20 kernel/locking/lockdep.c:4243 mark_lock+0x223/0x350 kernel/locking/lockdep.c:4678 __lock_acquire+0xbcd/0x1fd0 kernel/locking/lockdep.c:5091 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] snd_pcm_period_elapsed+0x21/0x50 sound/core/pcm_lib.c:1904 dummy_hrtimer_callback+0x7f/0x180 sound/drivers/dummy.c:385 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x595/0xd00 kernel/time/hrtimer.c:1756 hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1773 __do_softirq+0x2bc/0x943 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:227 [inline] RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:239 [inline] RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] RIP: 0010:tomoyo_check_acl+0x2d8/0x3f0 security/tomoyo/domain.c:184 Code: 10 0f 83 1f 01 00 00 49 ff c4 49 8d 5c 24 ff 48 89 d8 48 c1 e8 06 49 8d 3c c6 be 08 00 00 00 e8 fe 61 9a fd 31 f6 49 0f a3 1e <40> 0f 93 c5 40 0f 92 c6 bf 02 00 00 00 e8 76 61 3a fd 40 84 ed 74 RSP: 0018:ffffc9000d757538 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 00000000000000f1 RCX: ffffffff845a95c2 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88802c6955c8 RBP: ffff88802d29ca01 R08: ffff88802c6955cf R09: 1ffff110058d2ab9 R10: dffffc0000000000 R11: ffffed10058d2aba R12: 00000000000000f2 R13: dffffc0000000000 R14: ffff88802c6955b0 R15: ffff88802c695590 tomoyo_path_permission+0x1af/0x360 security/tomoyo/file.c:586 tomoyo_check_open_permission+0x479/0x500 security/tomoyo/file.c:780 security_file_open+0x69/0x570 security/security.c:2955 do_dentry_open+0x327/0x15a0 fs/open.c:942 do_open fs/namei.c:3642 [inline] path_openat+0x2860/0x3240 fs/namei.c:3799 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f26d9d169a4 Code: 24 20 48 8d 44 24 30 48 89 44 24 28 64 8b 04 25 18 00 00 00 85 c0 75 2c 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 60 48 8b 15 55 a4 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007fff1d0333b0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f26d9d169a4 RDX: 0000000000080241 RSI: 00007fff1d0338f8 RDI: 00000000ffffff9c RBP: 00007fff1d0338f8 R08: 0000000000000004 R09: 0000000000000001 R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000080241 R13: 0000558e781c772e R14: 0000000000000001 R15: 0000558ea7e50910 ---------------- Code disassembly (best guess): 0: 10 0f adc %cl,(%rdi) 2: 83 1f 01 sbbl $0x1,(%rdi) 5: 00 00 add %al,(%rax) 7: 49 ff c4 inc %r12 a: 49 8d 5c 24 ff lea -0x1(%r12),%rbx f: 48 89 d8 mov %rbx,%rax 12: 48 c1 e8 06 shr $0x6,%rax 16: 49 8d 3c c6 lea (%r14,%rax,8),%rdi 1a: be 08 00 00 00 mov $0x8,%esi 1f: e8 fe 61 9a fd call 0xfd9a6222 24: 31 f6 xor %esi,%esi 26: 49 0f a3 1e bt %rbx,(%r14) * 2a: 40 0f 93 c5 setae %bpl <-- trapping instruction 2e: 40 0f 92 c6 setb %sil 32: bf 02 00 00 00 mov $0x2,%edi 37: e8 76 61 3a fd call 0xfd3a61b2 3c: 40 84 ed test %bpl,%bpl 3f: 74 .byte 0x74