======================================================== WARNING: possible irq lock inversion dependency detected 5.9.0-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor.4/8452 just changed the state of lock: ffff888214eb9108 (&group->lock){..-.}-{2:2}, at: snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1799 but this lock took another, SOFTIRQ-READ-unsafe lock in the past: (&card->ctl_files_rwlock){.+.+}-{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(&card->ctl_files_rwlock); local_irq_disable(); lock(&group->lock); lock(&card->ctl_files_rwlock); lock(&group->lock); *** DEADLOCK *** 3 locks held by syz-executor.4/8452: #0: ffff8880857e1c90 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline] #0: ffff8880857e1c90 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: __sock_release net/socket.c:595 [inline] #0: ffff8880857e1c90 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: sock_close+0x94/0x260 net/socket.c:1277 #1: ffffffff89beb778 (rtnl_mutex){+.+.}-{3:3}, at: ip6mr_sk_done+0x9e/0x2d0 net/ipv6/ip6mr.c:1583 #2: ffffc90000da8db0 ((&dpcm->timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:45 [inline] #2: ffffc90000da8db0 ((&dpcm->timer)){+.-.}-{0:0}, at: call_timer_fn+0x57/0x160 kernel/time/timer.c:1405 the shortest dependencies between 2nd lock and 1st lock: -> (&card->ctl_files_rwlock){.+.+}-{2:2} { HARDIRQ-ON-R at: lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 snd_ctl_notify+0x86/0x550 sound/core/control.c:153 __snd_ctl_add_replace+0x582/0x8a0 sound/core/control.c:382 snd_ctl_add_replace sound/core/control.c:399 [inline] snd_ctl_add+0x6e/0x110 sound/core/control.c:426 snd_card_dummy_new_mixer sound/drivers/dummy.c:885 [inline] snd_dummy_probe+0xb9e/0x1000 sound/drivers/dummy.c:1080 platform_drv_probe+0xcd/0x150 drivers/base/platform.c:747 really_probe+0x753/0x1110 drivers/base/dd.c:557 driver_probe_device+0x106/0x1a0 drivers/base/dd.c:738 bus_for_each_drv+0x108/0x170 drivers/base/bus.c:431 __device_attach+0x262/0x3f0 drivers/base/dd.c:912 bus_probe_device+0xb8/0x1f0 drivers/base/bus.c:491 device_add+0x1630/0x19b0 drivers/base/core.c:2926 platform_device_add+0x4ad/0x6e0 drivers/base/platform.c:597 platform_device_register_full+0x448/0x530 drivers/base/platform.c:720 platform_device_register_resndata include/linux/platform_device.h:131 [inline] platform_device_register_simple include/linux/platform_device.h:160 [inline] alsa_card_dummy_init+0x1b3/0x398 sound/drivers/dummy.c:1168 do_one_initcall+0x14b/0x350 init/main.c:1205 do_initcall_level+0x101/0x14c init/main.c:1278 do_initcalls+0x59/0x9b init/main.c:1294 kernel_init_freeable+0x356/0x474 init/main.c:1514 kernel_init+0xd/0x290 init/main.c:1403 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 SOFTIRQ-ON-R at: lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 snd_ctl_notify+0x86/0x550 sound/core/control.c:153 __snd_ctl_add_replace+0x582/0x8a0 sound/core/control.c:382 snd_ctl_add_replace sound/core/control.c:399 [inline] snd_ctl_add+0x6e/0x110 sound/core/control.c:426 snd_card_dummy_new_mixer sound/drivers/dummy.c:885 [inline] snd_dummy_probe+0xb9e/0x1000 sound/drivers/dummy.c:1080 platform_drv_probe+0xcd/0x150 drivers/base/platform.c:747 really_probe+0x753/0x1110 drivers/base/dd.c:557 driver_probe_device+0x106/0x1a0 drivers/base/dd.c:738 bus_for_each_drv+0x108/0x170 drivers/base/bus.c:431 __device_attach+0x262/0x3f0 drivers/base/dd.c:912 bus_probe_device+0xb8/0x1f0 drivers/base/bus.c:491 device_add+0x1630/0x19b0 drivers/base/core.c:2926 platform_device_add+0x4ad/0x6e0 drivers/base/platform.c:597 platform_device_register_full+0x448/0x530 drivers/base/platform.c:720 platform_device_register_resndata include/linux/platform_device.h:131 [inline] platform_device_register_simple include/linux/platform_device.h:160 [inline] alsa_card_dummy_init+0x1b3/0x398 sound/drivers/dummy.c:1168 do_one_initcall+0x14b/0x350 init/main.c:1205 do_initcall_level+0x101/0x14c init/main.c:1278 do_initcalls+0x59/0x9b init/main.c:1294 kernel_init_freeable+0x356/0x474 init/main.c:1514 kernel_init+0xd/0x290 init/main.c:1403 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 INITIAL READ USE at: lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 snd_ctl_notify+0x86/0x550 sound/core/control.c:153 __snd_ctl_add_replace+0x582/0x8a0 sound/core/control.c:382 snd_ctl_add_replace sound/core/control.c:399 [inline] snd_ctl_add+0x6e/0x110 sound/core/control.c:426 snd_card_dummy_new_mixer sound/drivers/dummy.c:885 [inline] snd_dummy_probe+0xb9e/0x1000 sound/drivers/dummy.c:1080 platform_drv_probe+0xcd/0x150 drivers/base/platform.c:747 really_probe+0x753/0x1110 drivers/base/dd.c:557 driver_probe_device+0x106/0x1a0 drivers/base/dd.c:738 bus_for_each_drv+0x108/0x170 drivers/base/bus.c:431 __device_attach+0x262/0x3f0 drivers/base/dd.c:912 bus_probe_device+0xb8/0x1f0 drivers/base/bus.c:491 device_add+0x1630/0x19b0 drivers/base/core.c:2926 platform_device_add+0x4ad/0x6e0 drivers/base/platform.c:597 platform_device_register_full+0x448/0x530 drivers/base/platform.c:720 platform_device_register_resndata include/linux/platform_device.h:131 [inline] platform_device_register_simple include/linux/platform_device.h:160 [inline] alsa_card_dummy_init+0x1b3/0x398 sound/drivers/dummy.c:1168 do_one_initcall+0x14b/0x350 init/main.c:1205 do_initcall_level+0x101/0x14c init/main.c:1278 do_initcalls+0x59/0x9b init/main.c:1294 kernel_init_freeable+0x356/0x474 init/main.c:1514 kernel_init+0xd/0x290 init/main.c:1403 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 } ... key at: [] snd_card_new.__key.3+0x0/0x10 ... acquired at: lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 snd_ctl_notify+0x86/0x550 sound/core/control.c:153 loopback_trigger+0xfbb/0x1500 sound/drivers/aloop.c:194 snd_pcm_do_start sound/core/pcm_native.c:1350 [inline] snd_pcm_action_single sound/core/pcm_native.c:1207 [inline] snd_pcm_action sound/core/pcm_native.c:1290 [inline] snd_pcm_start+0x471/0x6c0 sound/core/pcm_native.c:1391 __snd_pcm_lib_xfer+0xf73/0x1320 sound/core/pcm_lib.c:2247 snd_pcm_oss_write3+0x209/0x330 sound/core/oss/pcm_oss.c:1221 snd_pcm_plug_write_transfer+0x28b/0x490 sound/core/oss/pcm_plugin.c:624 snd_pcm_oss_write2+0x156/0x370 sound/core/oss/pcm_oss.c:1353 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1419 [inline] snd_pcm_oss_write+0x911/0xd70 sound/core/oss/pcm_oss.c:2765 vfs_write+0x2dd/0xd20 fs/read_write.c:584 ksys_write+0x11b/0x220 fs/read_write.c:639 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> (&group->lock){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xaa/0xd0 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1799 call_timer_fn+0x91/0x160 kernel/time/timer.c:1415 expire_timers kernel/time/timer.c:1460 [inline] __run_timers+0x65e/0x830 kernel/time/timer.c:1757 run_timer_softirq+0x46/0x80 kernel/time/timer.c:1770 __do_softirq+0x256/0x6e0 kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x9a/0xf0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu+0x21f/0x230 kernel/softirq.c:423 irq_exit_rcu+0x5/0x20 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0xe0/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:581 arch_local_irq_enable arch/x86/include/asm/paravirt.h:663 [inline] __local_bh_enable_ip+0x160/0x1d0 kernel/softirq.c:200 get_next_corpse net/netfilter/nf_conntrack_core.c:2226 [inline] nf_ct_iterate_cleanup+0x357/0x3e0 net/netfilter/nf_conntrack_core.c:2249 nf_ct_iterate_cleanup_net+0xfc/0x150 net/netfilter/nf_conntrack_core.c:2334 masq_device_event+0x9b/0xd0 net/netfilter/nf_nat_masquerade.c:88 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2033 [inline] call_netdevice_notifiers_extack net/core/dev.c:2045 [inline] call_netdevice_notifiers net/core/dev.c:2059 [inline] dev_close_many+0x31a/0x4d0 net/core/dev.c:1634 rollback_registered_many+0x454/0x1380 net/core/dev.c:9324 unregister_netdevice_many+0x46/0x260 net/core/dev.c:10509 mroute_clean_tables+0x211/0x970 net/ipv6/ip6mr.c:1514 ip6mr_sk_done+0x255/0x2d0 net/ipv6/ip6mr.c:1599 rawv6_close+0x5f/0x80 net/ipv6/raw.c:1198 inet_release+0x16e/0x1f0 net/ipv4/af_inet.c:431 __sock_release net/socket.c:596 [inline] sock_close+0xd8/0x260 net/socket.c:1277 __fput+0x34f/0x7b0 fs/file_table.c:281 task_work_run+0x137/0x1c0 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:165 [inline] exit_to_user_mode_prepare+0x125/0x1f0 kernel/entry/common.c:192 syscall_exit_to_user_mode+0x82/0x1d0 kernel/entry/common.c:267 entry_SYSCALL_64_after_hwframe+0x44/0xa9 INITIAL USE at: lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0xa6/0xc0 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:379 [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] snd_pcm_hw_params+0xca/0x16b0 sound/core/pcm_native.c:672 snd_pcm_oss_change_params_locked+0x25e0/0x4410 sound/core/oss/pcm_oss.c:941 snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1084 [inline] snd_pcm_oss_make_ready+0x115/0x2b0 sound/core/oss/pcm_oss.c:1143 snd_pcm_oss_sync+0x199/0x900 sound/core/oss/pcm_oss.c:1708 snd_pcm_oss_ioctl+0x8a3/0x4660 sound/core/oss/pcm_oss.c:2590 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:739 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] snd_pcm_group_init.__key+0x0/0x10 ... acquired at: mark_usage kernel/locking/lockdep.c:4305 [inline] __lock_acquire+0xa67/0x2bd0 kernel/locking/lockdep.c:4791 lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xaa/0xd0 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1799 call_timer_fn+0x91/0x160 kernel/time/timer.c:1415 expire_timers kernel/time/timer.c:1460 [inline] __run_timers+0x65e/0x830 kernel/time/timer.c:1757 run_timer_softirq+0x46/0x80 kernel/time/timer.c:1770 __do_softirq+0x256/0x6e0 kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x9a/0xf0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu+0x21f/0x230 kernel/softirq.c:423 irq_exit_rcu+0x5/0x20 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0xe0/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:581 arch_local_irq_enable arch/x86/include/asm/paravirt.h:663 [inline] __local_bh_enable_ip+0x160/0x1d0 kernel/softirq.c:200 get_next_corpse net/netfilter/nf_conntrack_core.c:2226 [inline] nf_ct_iterate_cleanup+0x357/0x3e0 net/netfilter/nf_conntrack_core.c:2249 nf_ct_iterate_cleanup_net+0xfc/0x150 net/netfilter/nf_conntrack_core.c:2334 masq_device_event+0x9b/0xd0 net/netfilter/nf_nat_masquerade.c:88 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2033 [inline] call_netdevice_notifiers_extack net/core/dev.c:2045 [inline] call_netdevice_notifiers net/core/dev.c:2059 [inline] dev_close_many+0x31a/0x4d0 net/core/dev.c:1634 rollback_registered_many+0x454/0x1380 net/core/dev.c:9324 unregister_netdevice_many+0x46/0x260 net/core/dev.c:10509 mroute_clean_tables+0x211/0x970 net/ipv6/ip6mr.c:1514 ip6mr_sk_done+0x255/0x2d0 net/ipv6/ip6mr.c:1599 rawv6_close+0x5f/0x80 net/ipv6/raw.c:1198 inet_release+0x16e/0x1f0 net/ipv4/af_inet.c:431 __sock_release net/socket.c:596 [inline] sock_close+0xd8/0x260 net/socket.c:1277 __fput+0x34f/0x7b0 fs/file_table.c:281 task_work_run+0x137/0x1c0 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:165 [inline] exit_to_user_mode_prepare+0x125/0x1f0 kernel/entry/common.c:192 syscall_exit_to_user_mode+0x82/0x1d0 kernel/entry/common.c:267 entry_SYSCALL_64_after_hwframe+0x44/0xa9 stack backtrace: CPU: 1 PID: 8452 Comm: syz-executor.4 Not tainted 5.9.0-syzkaller #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+0x1d6/0x29e lib/dump_stack.c:118 print_irq_inversion_bug+0xa5c/0xd70 kernel/locking/lockdep.c:3817 check_usage_forwards kernel/locking/lockdep.c:191 [inline] mark_lock_irq kernel/locking/lockdep.c:3980 [inline] mark_lock+0xe80/0x2050 kernel/locking/lockdep.c:4408 mark_usage kernel/locking/lockdep.c:4305 [inline] __lock_acquire+0xa67/0x2bd0 kernel/locking/lockdep.c:4791 lock_acquire+0x160/0x710 kernel/locking/lockdep.c:5442 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xaa/0xd0 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1799 call_timer_fn+0x91/0x160 kernel/time/timer.c:1415 expire_timers kernel/time/timer.c:1460 [inline] __run_timers+0x65e/0x830 kernel/time/timer.c:1757 run_timer_softirq+0x46/0x80 kernel/time/timer.c:1770 __do_softirq+0x256/0x6e0 kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x9a/0xf0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu+0x21f/0x230 kernel/softirq.c:423 irq_exit_rcu+0x5/0x20 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0xe0/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:581 RIP: 0010:should_resched arch/x86/include/asm/preempt.h:102 [inline] RIP: 0010:__local_bh_enable_ip+0x160/0x1d0 kernel/softirq.c:202 Code: 8d 89 48 c1 e8 03 42 80 3c 38 00 74 0c 48 c7 c7 30 2e 8d 89 e8 61 53 6d 00 48 83 3d 39 de 44 08 00 74 6a fb 66 0f 1f 44 00 00 <65> 8b 05 05 ae b9 7e 85 c0 75 05 e8 87 20 b8 ff 5b 41 5e 41 5f 5d RSP: 0018:ffffc900169779f8 EFLAGS: 00000286 RAX: 1ffffffff131a5c6 RBX: 0000000000000286 RCX: ffff888050dac2c0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00000000000001ff R08: dffffc0000000000 R09: fffffbfff16e4a94 R10: fffffbfff16e4a94 R11: 0000000000000000 R12: 0000000000006cf1 R13: dffffc0000000000 R14: ffffffff86d93f65 R15: dffffc0000000000 get_next_corpse net/netfilter/nf_conntrack_core.c:2226 [inline] nf_ct_iterate_cleanup+0x357/0x3e0 net/netfilter/nf_conntrack_core.c:2249 nf_ct_iterate_cleanup_net+0xfc/0x150 net/netfilter/nf_conntrack_core.c:2334 masq_device_event+0x9b/0xd0 net/netfilter/nf_nat_masquerade.c:88 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2033 [inline] call_netdevice_notifiers_extack net/core/dev.c:2045 [inline] call_netdevice_notifiers net/core/dev.c:2059 [inline] dev_close_many+0x31a/0x4d0 net/core/dev.c:1634 rollback_registered_many+0x454/0x1380 net/core/dev.c:9324 unregister_netdevice_many+0x46/0x260 net/core/dev.c:10509 mroute_clean_tables+0x211/0x970 net/ipv6/ip6mr.c:1514 ip6mr_sk_done+0x255/0x2d0 net/ipv6/ip6mr.c:1599 rawv6_close+0x5f/0x80 net/ipv6/raw.c:1198 inet_release+0x16e/0x1f0 net/ipv4/af_inet.c:431 __sock_release net/socket.c:596 [inline] sock_close+0xd8/0x260 net/socket.c:1277 __fput+0x34f/0x7b0 fs/file_table.c:281 task_work_run+0x137/0x1c0 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:165 [inline] exit_to_user_mode_prepare+0x125/0x1f0 kernel/entry/common.c:192 syscall_exit_to_user_mode+0x82/0x1d0 kernel/entry/common.c:267 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4177b1 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 a4 1a 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffd396c3e80 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00000000004177b1 RDX: 0000000000000000 RSI: 0000000000000081 RDI: 0000000000000006 RBP: 0000000000000000 R08: 0000000001191680 R09: 0000000000000000 R10: 00007ffd396c3f50 R11: 0000000000000293 R12: ffffffffffffffff R13: 0000000000000000 R14: 0000000000000005 R15: 000000000118bf2c