===================================================== WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected 5.9.0-rc5-next-20200918-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.5/26758 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffff888099b28760 (&card->ctl_files_rwlock){.+.+}-{2:2}, at: snd_ctl_notify.part.0+0x36/0x550 sound/core/control.c:153 and this task is already holding: ffff8882153ef108 (&group->lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline] ffff8882153ef108 (&group->lock){..-.}-{2:2}, at: snd_pcm_group_lock_irq sound/core/pcm_native.c:97 [inline] ffff8882153ef108 (&group->lock){..-.}-{2:2}, at: snd_pcm_stream_lock_irq+0x8e/0xb0 sound/core/pcm_native.c:136 which would create a new lock dependency: (&group->lock){..-.}-{2:2} -> (&card->ctl_files_rwlock){.+.+}-{2:2} but this new dependency connects a SOFTIRQ-irq-safe lock: (&group->lock){..-.}-{2:2} ... which became SOFTIRQ-irq-safe at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x94/0xd0 kernel/locking/spinlock.c:159 _snd_pcm_stream_lock_irqsave+0x9f/0xd0 sound/core/pcm_native.c:170 snd_pcm_period_elapsed+0x24/0x250 sound/core/pcm_lib.c:1799 dummy_hrtimer_callback+0x94/0x1b0 sound/drivers/dummy.c:378 __run_hrtimer kernel/time/hrtimer.c:1524 [inline] __hrtimer_run_queues+0x693/0xea0 kernel/time/hrtimer.c:1588 hrtimer_run_softirq+0x17b/0x360 kernel/time/hrtimer.c:1605 __do_softirq+0x203/0xab6 kernel/softirq.c:298 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:786 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] do_softirq_own_stack+0x9d/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x235/0x280 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x51/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:631 arch_local_irq_restore arch/x86/include/asm/paravirt.h:653 [inline] rmqueue_pcplist mm/page_alloc.c:3353 [inline] rmqueue mm/page_alloc.c:3370 [inline] get_page_from_freelist+0x13bc/0x3cb0 mm/page_alloc.c:3828 __alloc_pages_nodemask+0x2d6/0x730 mm/page_alloc.c:4873 alloc_pages_current+0x191/0x2a0 mm/mempolicy.c:2275 alloc_pages include/linux/gfp.h:545 [inline] __get_free_pages mm/page_alloc.c:4916 [inline] get_zeroed_page+0x10/0x40 mm/page_alloc.c:4925 pud_alloc_one include/asm-generic/pgalloc.h:166 [inline] __pud_alloc+0x36/0x250 mm/memory.c:4495 pud_alloc include/linux/mm.h:2112 [inline] copy_pud_range mm/memory.c:919 [inline] copy_p4d_range mm/memory.c:961 [inline] copy_page_range+0x17ea/0x2840 mm/memory.c:1023 dup_mmap kernel/fork.c:592 [inline] dup_mm+0x98f/0x1300 kernel/fork.c:1354 copy_mm kernel/fork.c:1410 [inline] copy_process+0x2ab0/0x6e70 kernel/fork.c:2088 kernel_clone+0xe5/0xae0 kernel/fork.c:2449 __do_sys_clone+0xc8/0x110 kernel/fork.c:2566 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 to a SOFTIRQ-irq-unsafe lock: (&card->ctl_files_rwlock){.+.+}-{2:2} ... which became SOFTIRQ-irq-unsafe at: ... lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 snd_ctl_notify.part.0+0x36/0x550 sound/core/control.c:153 snd_ctl_notify+0x8f/0xb0 sound/core/control.c:181 __snd_ctl_add_replace+0x638/0x800 sound/core/control.c:382 snd_ctl_add_replace+0x76/0x130 sound/core/control.c:399 snd_card_dummy_new_mixer sound/drivers/dummy.c:885 [inline] snd_dummy_probe+0xc22/0x1180 sound/drivers/dummy.c:1080 platform_drv_probe+0x87/0x140 drivers/base/platform.c:761 really_probe+0x282/0x9f0 drivers/base/dd.c:553 driver_probe_device+0xfe/0x1d0 drivers/base/dd.c:737 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:843 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x470 drivers/base/dd.c:911 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xb17/0x1c40 drivers/base/core.c:2928 platform_device_add+0x34f/0x6d0 drivers/base/platform.c:611 platform_device_register_full+0x38c/0x4e0 drivers/base/platform.c:734 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+0x1e0/0x309 sound/drivers/dummy.c:1168 do_one_initcall+0x103/0x6f0 init/main.c:1204 do_initcall_level init/main.c:1277 [inline] do_initcalls init/main.c:1293 [inline] do_basic_setup init/main.c:1313 [inline] kernel_init_freeable+0x652/0x6d6 init/main.c:1512 kernel_init+0xd/0x1b8 init/main.c:1402 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 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 *** 1 lock held by syz-executor.5/26758: #0: ffff8882153ef108 (&group->lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline] #0: ffff8882153ef108 (&group->lock){..-.}-{2:2}, at: snd_pcm_group_lock_irq sound/core/pcm_native.c:97 [inline] #0: ffff8882153ef108 (&group->lock){..-.}-{2:2}, at: snd_pcm_stream_lock_irq+0x8e/0xb0 sound/core/pcm_native.c:136 the dependencies between SOFTIRQ-irq-safe lock and the holding lock: -> (&group->lock){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x94/0xd0 kernel/locking/spinlock.c:159 _snd_pcm_stream_lock_irqsave+0x9f/0xd0 sound/core/pcm_native.c:170 snd_pcm_period_elapsed+0x24/0x250 sound/core/pcm_lib.c:1799 dummy_hrtimer_callback+0x94/0x1b0 sound/drivers/dummy.c:378 __run_hrtimer kernel/time/hrtimer.c:1524 [inline] __hrtimer_run_queues+0x693/0xea0 kernel/time/hrtimer.c:1588 hrtimer_run_softirq+0x17b/0x360 kernel/time/hrtimer.c:1605 __do_softirq+0x203/0xab6 kernel/softirq.c:298 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:786 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] do_softirq_own_stack+0x9d/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x235/0x280 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x51/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:631 arch_local_irq_restore arch/x86/include/asm/paravirt.h:653 [inline] rmqueue_pcplist mm/page_alloc.c:3353 [inline] rmqueue mm/page_alloc.c:3370 [inline] get_page_from_freelist+0x13bc/0x3cb0 mm/page_alloc.c:3828 __alloc_pages_nodemask+0x2d6/0x730 mm/page_alloc.c:4873 alloc_pages_current+0x191/0x2a0 mm/mempolicy.c:2275 alloc_pages include/linux/gfp.h:545 [inline] __get_free_pages mm/page_alloc.c:4916 [inline] get_zeroed_page+0x10/0x40 mm/page_alloc.c:4925 pud_alloc_one include/asm-generic/pgalloc.h:166 [inline] __pud_alloc+0x36/0x250 mm/memory.c:4495 pud_alloc include/linux/mm.h:2112 [inline] copy_pud_range mm/memory.c:919 [inline] copy_p4d_range mm/memory.c:961 [inline] copy_page_range+0x17ea/0x2840 mm/memory.c:1023 dup_mmap kernel/fork.c:592 [inline] dup_mm+0x98f/0x1300 kernel/fork.c:1354 copy_mm kernel/fork.c:1410 [inline] copy_process+0x2ab0/0x6e70 kernel/fork.c:2088 kernel_clone+0xe5/0xae0 kernel/fork.c:2449 __do_sys_clone+0xc8/0x110 kernel/fork.c:2566 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 INITIAL USE at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x94/0xd0 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+0x12a/0x1920 sound/core/pcm_native.c:672 snd_pcm_kernel_ioctl+0xd1/0x240 sound/core/pcm_native.c:3325 snd_pcm_oss_change_params_locked+0x130a/0x3420 sound/core/oss/pcm_oss.c:941 snd_pcm_oss_make_ready_locked+0xb3/0x230 sound/core/oss/pcm_oss.c:1166 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1384 [inline] snd_pcm_oss_write+0x45d/0x940 sound/core/oss/pcm_oss.c:2765 do_loop_readv_writev fs/read_write.c:754 [inline] do_loop_readv_writev fs/read_write.c:738 [inline] do_iter_write+0x489/0x670 fs/read_write.c:1037 vfs_writev+0x1aa/0x2e0 fs/read_write.c:1108 do_writev+0x139/0x300 fs/read_write.c:1151 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] __key.7+0x0/0x40 ... acquired at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 snd_ctl_notify.part.0+0x36/0x550 sound/core/control.c:153 snd_ctl_notify+0x8f/0xb0 sound/core/control.c:181 loopback_check_format sound/drivers/aloop.c:358 [inline] loopback_trigger+0x112f/0x1ab0 sound/drivers/aloop.c:387 snd_pcm_do_start sound/core/pcm_native.c:1350 [inline] snd_pcm_do_start+0xb1/0xf0 sound/core/pcm_native.c:1345 snd_pcm_action_single sound/core/pcm_native.c:1207 [inline] snd_pcm_action+0xc8/0x170 sound/core/pcm_native.c:1290 __snd_pcm_lib_xfer+0x1202/0x1a90 sound/core/pcm_lib.c:2247 snd_pcm_oss_write3+0x107/0x320 sound/core/oss/pcm_oss.c:1221 io_playback_transfer+0x27e/0x330 sound/core/oss/io.c:47 snd_pcm_plug_write_transfer+0x2cd/0x3f0 sound/core/oss/pcm_plugin.c:624 snd_pcm_oss_write2+0x245/0x3f0 sound/core/oss/pcm_oss.c:1353 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1419 [inline] snd_pcm_oss_write+0x705/0x940 sound/core/oss/pcm_oss.c:2765 vfs_write+0x28e/0x700 fs/read_write.c:593 ksys_write+0x12d/0x250 fs/read_write.c:648 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 the dependencies between the lock to be acquired and SOFTIRQ-irq-unsafe lock: -> (&card->ctl_files_rwlock){.+.+}-{2:2} { HARDIRQ-ON-R at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 snd_ctl_notify.part.0+0x36/0x550 sound/core/control.c:153 snd_ctl_notify+0x8f/0xb0 sound/core/control.c:181 __snd_ctl_add_replace+0x638/0x800 sound/core/control.c:382 snd_ctl_add_replace+0x76/0x130 sound/core/control.c:399 snd_card_dummy_new_mixer sound/drivers/dummy.c:885 [inline] snd_dummy_probe+0xc22/0x1180 sound/drivers/dummy.c:1080 platform_drv_probe+0x87/0x140 drivers/base/platform.c:761 really_probe+0x282/0x9f0 drivers/base/dd.c:553 driver_probe_device+0xfe/0x1d0 drivers/base/dd.c:737 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:843 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x470 drivers/base/dd.c:911 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xb17/0x1c40 drivers/base/core.c:2928 platform_device_add+0x34f/0x6d0 drivers/base/platform.c:611 platform_device_register_full+0x38c/0x4e0 drivers/base/platform.c:734 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+0x1e0/0x309 sound/drivers/dummy.c:1168 do_one_initcall+0x103/0x6f0 init/main.c:1204 do_initcall_level init/main.c:1277 [inline] do_initcalls init/main.c:1293 [inline] do_basic_setup init/main.c:1313 [inline] kernel_init_freeable+0x652/0x6d6 init/main.c:1512 kernel_init+0xd/0x1b8 init/main.c:1402 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 SOFTIRQ-ON-R at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 snd_ctl_notify.part.0+0x36/0x550 sound/core/control.c:153 snd_ctl_notify+0x8f/0xb0 sound/core/control.c:181 __snd_ctl_add_replace+0x638/0x800 sound/core/control.c:382 snd_ctl_add_replace+0x76/0x130 sound/core/control.c:399 snd_card_dummy_new_mixer sound/drivers/dummy.c:885 [inline] snd_dummy_probe+0xc22/0x1180 sound/drivers/dummy.c:1080 platform_drv_probe+0x87/0x140 drivers/base/platform.c:761 really_probe+0x282/0x9f0 drivers/base/dd.c:553 driver_probe_device+0xfe/0x1d0 drivers/base/dd.c:737 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:843 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x470 drivers/base/dd.c:911 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xb17/0x1c40 drivers/base/core.c:2928 platform_device_add+0x34f/0x6d0 drivers/base/platform.c:611 platform_device_register_full+0x38c/0x4e0 drivers/base/platform.c:734 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+0x1e0/0x309 sound/drivers/dummy.c:1168 do_one_initcall+0x103/0x6f0 init/main.c:1204 do_initcall_level init/main.c:1277 [inline] do_initcalls init/main.c:1293 [inline] do_basic_setup init/main.c:1313 [inline] kernel_init_freeable+0x652/0x6d6 init/main.c:1512 kernel_init+0xd/0x1b8 init/main.c:1402 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 (null) at: ================================================================================ UBSAN: array-index-out-of-bounds in kernel/locking/lockdep.c:2240:40 index 9 is out of range for type 'lock_trace *[9]' CPU: 0 PID: 26758 Comm: syz-executor.5 Not tainted 5.9.0-rc5-next-20200918-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+0x198/0x1fb lib/dump_stack.c:118 ubsan_epilogue+0xb/0x5a lib/ubsan.c:148 __ubsan_handle_out_of_bounds.cold+0x62/0x6c lib/ubsan.c:356 print_lock_class_header kernel/locking/lockdep.c:2240 [inline] print_shortest_lock_dependencies.cold+0x11c/0x2e2 kernel/locking/lockdep.c:2263 print_bad_irq_dependency kernel/locking/lockdep.c:2402 [inline] check_irq_usage.cold+0x49c/0x613 kernel/locking/lockdep.c:2634 check_prev_add kernel/locking/lockdep.c:2823 [inline] check_prevs_add kernel/locking/lockdep.c:2944 [inline] validate_chain kernel/locking/lockdep.c:3562 [inline] __lock_acquire+0x2873/0x56d0 kernel/locking/lockdep.c:4796 lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5398 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 snd_ctl_notify.part.0+0x36/0x550 sound/core/control.c:153 snd_ctl_notify+0x8f/0xb0 sound/core/control.c:181 loopback_check_format sound/drivers/aloop.c:358 [inline] loopback_trigger+0x112f/0x1ab0 sound/drivers/aloop.c:387 snd_pcm_do_start sound/core/pcm_native.c:1350 [inline] snd_pcm_do_start+0xb1/0xf0 sound/core/pcm_native.c:1345 snd_pcm_action_single sound/core/pcm_native.c:1207 [inline] snd_pcm_action+0xc8/0x170 sound/core/pcm_native.c:1290 __snd_pcm_lib_xfer+0x1202/0x1a90 sound/core/pcm_lib.c:2247 snd_pcm_oss_write3+0x107/0x320 sound/core/oss/pcm_oss.c:1221 io_playback_transfer+0x27e/0x330 sound/core/oss/io.c:47 snd_pcm_plug_write_transfer+0x2cd/0x3f0 sound/core/oss/pcm_plugin.c:624 snd_pcm_oss_write2+0x245/0x3f0 sound/core/oss/pcm_oss.c:1353 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1419 [inline] snd_pcm_oss_write+0x705/0x940 sound/core/oss/pcm_oss.c:2765 vfs_write+0x28e/0x700 fs/read_write.c:593 ksys_write+0x12d/0x250 fs/read_write.c:648 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45d5f9 Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f7c44391c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000038800 RCX: 000000000045d5f9 RDX: 0000000020000120 RSI: 0000000020000100 RDI: 0000000000000003 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007fff32f7ba5f R14: 00007f7c443929c0 R15: 000000000118cf4c ================================================================================