========================================================
WARNING: possible irq lock inversion dependency detected
6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted
--------------------------------------------------------
kauditd/28 just changed the state of lock:
ffff888029e89910 (&group->lock#2){..-.}-{2:2}, at: class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline]
ffff888029e89910 (&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);
  <Interrupt>
    lock(&group->lock#2);

 *** DEADLOCK ***

2 locks held by kauditd/28:
 #0: ffffffff8e00dc20 (console_lock){+.+.}-{0:0}, at: _printk+0xd5/0x120 kernel/printk/printk.c:2367
 #1: ffffffff8e00d850 (console_srcu){....}-{0:0}, at: rcu_try_lock_acquire include/linux/rcupdate.h:303 [inline]
 #1: ffffffff8e00d850 (console_srcu){....}-{0:0}, at: srcu_read_lock_nmisafe include/linux/srcu.h:232 [inline]
 #1: ffffffff8e00d850 (console_srcu){....}-{0:0}, at: console_srcu_read_lock kernel/printk/printk.c:286 [inline]
 #1: ffffffff8e00d850 (console_srcu){....}-{0:0}, at: console_flush_all+0x152/0xfd0 kernel/printk/printk.c:2965

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 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
  }
  ... key      at: [<ffffffff9485efe0>] 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_timer_notify sound/core/pcm_native.c:622 [inline]
   snd_pcm_post_stop sound/core/pcm_native.c:1520 [inline]
   snd_pcm_action sound/core/pcm_native.c:1370 [inline]
   snd_pcm_stop+0x358/0x490 sound/core/pcm_native.c:1543
   snd_pcm_drop+0x158/0x250 sound/core/pcm_native.c:2208
   snd_pcm_oss_sync+0x202/0xc30 sound/core/oss/pcm_oss.c:1734
   snd_pcm_oss_release+0x11e/0x280 sound/core/oss/pcm_oss.c:2575
   __fput+0x429/0x8a0 fs/file_table.c:422
   task_work_run+0x24f/0x310 kernel/task_work.c:180
   resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
   exit_to_user_mode_loop kernel/entry/common.c:108 [inline]
   exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
   __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline]
   syscall_exit_to_user_mode+0x168/0x360 kernel/entry/common.c:212
   do_syscall_64+0x10a/0x240 arch/x86/entry/common.c:89
   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
                    console_flush_all+0xaad/0xfd0
                    console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3042
                    vprintk_emit+0x5a6/0x770 kernel/printk/printk.c:2342
                    _printk+0xd5/0x120 kernel/printk/printk.c:2367
                    kauditd_printk_skb kernel/audit.c:546 [inline]
                    kauditd_hold_skb+0x1bc/0x210 kernel/audit.c:581
                    kauditd_send_queue+0x2b1/0x310 kernel/audit.c:766
                    kauditd_thread+0x75c/0x990 kernel/audit.c:890
                    kthread+0x2f0/0x390 kernel/kthread.c:388
                    ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
                    ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
   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
                   spin_lock_irq include/linux/spinlock.h:376 [inline]
                   snd_pcm_group_lock_irq sound/core/pcm_native.c:97 [inline]
                   snd_pcm_stream_lock_irq sound/core/pcm_native.c:136 [inline]
                   class_pcm_stream_lock_irq_constructor include/sound/pcm.h:666 [inline]
                   snd_pcm_hw_params+0x201/0x1ea0 sound/core/pcm_native.c:740
                   snd_pcm_oss_change_params_locked+0x20d5/0x3e00 sound/core/oss/pcm_oss.c:965
                   snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1105 [inline]
                   snd_pcm_oss_make_ready+0x11d/0x350 sound/core/oss/pcm_oss.c:1164
                   snd_pcm_oss_sync+0x1bd/0xc30 sound/core/oss/pcm_oss.c:1730
                   snd_pcm_oss_release+0x11e/0x280 sound/core/oss/pcm_oss.c:2575
                   __fput+0x429/0x8a0 fs/file_table.c:422
                   task_work_run+0x24f/0x310 kernel/task_work.c:180
                   resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
                   exit_to_user_mode_loop kernel/entry/common.c:108 [inline]
                   exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
                   __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline]
                   syscall_exit_to_user_mode+0x168/0x360 kernel/entry/common.c:212
                   do_syscall_64+0x10a/0x240 arch/x86/entry/common.c:89
                   entry_SYSCALL_64_after_hwframe+0x6d/0x75
 }
 ... key      at: [<ffffffff9485f200>] 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
   console_flush_all+0xaad/0xfd0
   console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3042
   vprintk_emit+0x5a6/0x770 kernel/printk/printk.c:2342
   _printk+0xd5/0x120 kernel/printk/printk.c:2367
   kauditd_printk_skb kernel/audit.c:546 [inline]
   kauditd_hold_skb+0x1bc/0x210 kernel/audit.c:581
   kauditd_send_queue+0x2b1/0x310 kernel/audit.c:766
   kauditd_thread+0x75c/0x990 kernel/audit.c:890
   kthread+0x2f0/0x390 kernel/kthread.c:388
   ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
   ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243


stack backtrace:
CPU: 0 PID: 28 Comm: kauditd 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:
 <IRQ>
 __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
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:console_flush_all+0xaad/0xfd0 kernel/printk/printk.c:2979
Code: ff ff e8 86 6e 1f 00 90 0f 0b 90 e9 d8 f8 ff ff e8 78 6e 1f 00 e8 03 0e f6 09 4d 85 f6 74 b6 e8 69 6e 1f 00 fb 48 8b 44 24 70 <42> 0f b6 04 38 84 c0 48 8b 7c 24 30 0f 85 22 02 00 00 0f b6 1f 31
RSP: 0018:ffffc90000a477e0 EFLAGS: 00000293
RAX: 1ffff92000148f48 RBX: 0000000000000000 RCX: ffff8880186b1e00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000a47990 R08: ffffffff81758584 R09: 1ffffffff2595ca0
R10: dffffc0000000000 R11: fffffbfff2595ca1 R12: ffffffff8e8e61f8
R13: ffffffff8e8e61a0 R14: 0000000000000200 R15: dffffc0000000000
 console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3042
 vprintk_emit+0x5a6/0x770 kernel/printk/printk.c:2342
 _printk+0xd5/0x120 kernel/printk/printk.c:2367
 kauditd_printk_skb kernel/audit.c:546 [inline]
 kauditd_hold_skb+0x1bc/0x210 kernel/audit.c:581
 kauditd_send_queue+0x2b1/0x310 kernel/audit.c:766
 kauditd_thread+0x75c/0x990 kernel/audit.c:890
 kthread+0x2f0/0x390 kernel/kthread.c:388
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
 </TASK>
----------------
Code disassembly (best guess), 2 bytes skipped:
   0:	e8 86 6e 1f 00       	call   0x1f6e8b
   5:	90                   	nop
   6:	0f 0b                	ud2
   8:	90                   	nop
   9:	e9 d8 f8 ff ff       	jmp    0xfffff8e6
   e:	e8 78 6e 1f 00       	call   0x1f6e8b
  13:	e8 03 0e f6 09       	call   0x9f60e1b
  18:	4d 85 f6             	test   %r14,%r14
  1b:	74 b6                	je     0xffffffd3
  1d:	e8 69 6e 1f 00       	call   0x1f6e8b
  22:	fb                   	sti
  23:	48 8b 44 24 70       	mov    0x70(%rsp),%rax
* 28:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2d:	84 c0                	test   %al,%al
  2f:	48 8b 7c 24 30       	mov    0x30(%rsp),%rdi
  34:	0f 85 22 02 00 00    	jne    0x25c
  3a:	0f b6 1f             	movzbl (%rdi),%ebx
  3d:	31                   	.byte 0x31