WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- syz-executor.1/6188 just changed the state of lock: ffff888025c2e948 (&timer->lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888025c2e948 (&timer->lock){+.+.}-{2:2}, at: class_spinlock_constructor include/linux/spinlock.h:561 [inline] ffff888025c2e948 (&timer->lock){+.+.}-{2:2}, at: snd_timer_close_locked+0x53/0x8d0 sound/core/timer.c:412 but this lock was taken by another, SOFTIRQ-safe lock in the past: (&group->lock#2){..-.}-{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 *** 3 locks held by syz-executor.1/6188: #0: ffffffff8f2d05e8 (register_mutex#3){+.+.}-{3:3}, at: seq_free_client+0x27/0x180 sound/core/seq/seq_clientmgr.c:298 #1: ffff88807ba2a178 (&q->timer_mutex){+.+.}-{3:3}, at: queue_delete sound/core/seq/seq_queue.c:124 [inline] #1: ffff88807ba2a178 (&q->timer_mutex){+.+.}-{3:3}, at: snd_seq_queue_client_leave+0x54/0x2b0 sound/core/seq/seq_queue.c:543 #2: ffffffff8f2c1a68 (register_mutex){+.+.}-{3:3}, at: class_mutex_constructor include/linux/mutex.h:169 [inline] #2: ffffffff8f2c1a68 (register_mutex){+.+.}-{3:3}, at: snd_timer_close+0xa3/0x130 sound/core/timer.c:463 the shortest dependencies between 2nd lock and 1st lock: -> (&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 lock_acquire+0x25b/0x530 kernel/locking/lockdep.c:5758 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 kernfs_find_and_get_ns+0x71/0x110 fs/kernfs/dir.c:909 kernfs_find_and_get include/linux/kernfs.h:602 [inline] sysfs_merge_group+0x10b/0x450 fs/sysfs/group.c:339 dpm_sysfs_add+0xd3/0x280 drivers/base/power/sysfs.c:707 device_add+0x5c3/0xca0 drivers/base/core.c:3599 netdev_register_kobject+0x17e/0x320 net/core/net-sysfs.c:2136 register_netdevice+0x1208/0x1a20 net/core/dev.c:10274 cfg80211_register_netdevice+0x149/0x2f0 net/wireless/core.c:1437 ieee80211_if_add+0xbbf/0x1770 net/mac80211/iface.c:2211 ieee80211_register_hw+0x321c/0x3d80 net/mac80211/main.c:1575 mac80211_hwsim_new_radio+0x25ac/0x4550 drivers/net/wireless/virtual/mac80211_hwsim.c:5454 hwsim_new_radio_nl+0xe4c/0x21d0 drivers/net/wireless/virtual/mac80211_hwsim.c:6135 genl_family_rcv_msg_doit net/netlink/genetlink.c:1113 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1193 [inline] genl_rcv_msg+0xb14/0xec0 net/netlink/genetlink.c:1208 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1217 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2191 __do_sys_sendto net/socket.c:2203 [inline] __se_sys_sendto net/socket.c:2199 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2199 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+0x48e/0x8c0 sound/core/oss/pcm_oss.c:2852 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: 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 -> (&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_client_leave+0x7f/0x2b0 sound/core/seq/seq_queue.c:543 seq_free_client1+0xfe/0x2b0 sound/core/seq/seq_clientmgr.c:285 seq_free_client+0x6c/0x180 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x48/0xc0 sound/core/seq/seq_clientmgr.c:387 __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_client_leave+0x7f/0x2b0 sound/core/seq/seq_queue.c:543 seq_free_client1+0xfe/0x2b0 sound/core/seq/seq_clientmgr.c:285 seq_free_client+0x6c/0x180 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x48/0xc0 sound/core/seq/seq_clientmgr.c:387 __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: mark_lock+0x223/0x350 kernel/locking/lockdep.c:4678 __lock_acquire+0x116e/0x1fd0 kernel/locking/lockdep.c:5091 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_client_leave+0x7f/0x2b0 sound/core/seq/seq_queue.c:543 seq_free_client1+0xfe/0x2b0 sound/core/seq/seq_clientmgr.c:285 seq_free_client+0x6c/0x180 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x48/0xc0 sound/core/seq/seq_clientmgr.c:387 __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 stack backtrace: CPU: 1 PID: 6188 Comm: syz-executor.1 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+0x867/0xc20 kernel/locking/lockdep.c:4236 mark_lock+0x223/0x350 kernel/locking/lockdep.c:4678 __lock_acquire+0x116e/0x1fd0 kernel/locking/lockdep.c:5091 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_client_leave+0x7f/0x2b0 sound/core/seq/seq_queue.c:543 seq_free_client1+0xfe/0x2b0 sound/core/seq/seq_clientmgr.c:285 seq_free_client+0x6c/0x180 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x48/0xc0 sound/core/seq/seq_clientmgr.c:387 __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 RIP: 0033:0x7fe64487cd5a Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007ffe59d45d00 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 000000000000000b RCX: 00007fe64487cd5a RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000000000a RBP: 0000000000000032 R08: 0000001b2ea20000 R09: 000000000000007c R10: 0000000081360ad3 R11: 0000000000000293 R12: 00007fe6444021e0 R13: ffffffffffffffff R14: 00007fe644400000 R15: 000000000001aa36