======================================================== WARNING: possible irq lock inversion dependency detected 5.9.0-syzkaller #0 Not tainted -------------------------------------------------------- systemd-udevd/8338 just changed the state of lock: ffff88809a173908 (&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 *** 2 locks held by systemd-udevd/8338: #0: ffffffff8adc2360 (tomoyo_ss){....}-{0:0}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:240 #1: ffffc90000da8db0 ((&dpcm->timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:45 [inline] #1: 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/0x6e0 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+0x12bb/0x1ff0 sound/drivers/dummy.c:1080 platform_drv_probe+0xcd/0x150 drivers/base/platform.c:761 really_probe+0x74b/0x1100 drivers/base/dd.c:558 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+0x15e6/0x1960 drivers/base/core.c:2936 platform_device_add+0x4ad/0x6e0 drivers/base/platform.c:611 platform_device_register_full+0x445/0x530 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+0x1b3/0x39c sound/drivers/dummy.c:1168 do_one_initcall+0x14b/0x350 init/main.c:1205 do_initcall_level+0x1fb/0x2c0 init/main.c:1278 do_initcalls+0x4b/0x8c 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:296 SOFTIRQ-ON-R at: lock_acquire+0x160/0x6e0 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+0x12bb/0x1ff0 sound/drivers/dummy.c:1080 platform_drv_probe+0xcd/0x150 drivers/base/platform.c:761 really_probe+0x74b/0x1100 drivers/base/dd.c:558 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+0x15e6/0x1960 drivers/base/core.c:2936 platform_device_add+0x4ad/0x6e0 drivers/base/platform.c:611 platform_device_register_full+0x445/0x530 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+0x1b3/0x39c sound/drivers/dummy.c:1168 do_one_initcall+0x14b/0x350 init/main.c:1205 do_initcall_level+0x1fb/0x2c0 init/main.c:1278 do_initcalls+0x4b/0x8c 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:296 INITIAL READ USE at: lock_acquire+0x160/0x6e0 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+0x12bb/0x1ff0 sound/drivers/dummy.c:1080 platform_drv_probe+0xcd/0x150 drivers/base/platform.c:761 really_probe+0x74b/0x1100 drivers/base/dd.c:558 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+0x15e6/0x1960 drivers/base/core.c:2936 platform_device_add+0x4ad/0x6e0 drivers/base/platform.c:611 platform_device_register_full+0x445/0x530 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+0x1b3/0x39c sound/drivers/dummy.c:1168 do_one_initcall+0x14b/0x350 init/main.c:1205 do_initcall_level+0x1fb/0x2c0 init/main.c:1278 do_initcalls+0x4b/0x8c 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:296 } ... key at: [] snd_card_new.__key.3+0x0/0x40 ... acquired at: lock_acquire+0x160/0x6e0 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_check_format sound/drivers/aloop.c:353 [inline] loopback_trigger+0xd10/0x17f0 sound/drivers/aloop.c:387 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+0x475/0x6d0 sound/core/pcm_native.c:1391 __snd_pcm_lib_xfer+0xf3d/0x12f0 sound/core/pcm_lib.c:2247 snd_pcm_oss_write3+0x209/0x330 sound/core/oss/pcm_oss.c:1221 snd_pcm_oss_write2+0x1bb/0x370 sound/core/oss/pcm_oss.c:1361 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/0xd10 fs/read_write.c:584 ksys_write+0x11b/0x220 fs/read_write.c:639 do_syscall_64+0x2d/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/0x6e0 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+0x770/0x9a0 kernel/time/timer.c:1757 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1770 __do_softirq+0x388/0x748 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/0xe0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu+0x200/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:631 arch_local_irq_restore arch/x86/include/asm/paravirt.h:653 [inline] kfree+0x140/0x210 mm/slab.c:3759 tomoyo_path_perm+0x475/0x5a0 security/tomoyo/file.c:842 security_inode_getattr+0xc0/0x140 security/security.c:1279 vfs_getattr fs/stat.c:121 [inline] vfs_statx+0x118/0x380 fs/stat.c:206 vfs_lstat include/linux/fs.h:3131 [inline] __do_sys_newlstat fs/stat.c:374 [inline] __se_sys_newlstat fs/stat.c:368 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:368 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 INITIAL USE at: lock_acquire+0x160/0x6e0 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/0x16a0 sound/core/pcm_native.c:672 snd_pcm_oss_change_params_locked+0x2102/0x3e00 sound/core/oss/pcm_oss.c:941 snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1084 [inline] snd_pcm_oss_get_active_substream+0x1ca/0x280 sound/core/oss/pcm_oss.c:1101 snd_pcm_oss_get_formats+0x34/0x360 sound/core/oss/pcm_oss.c:1817 snd_pcm_oss_set_format sound/core/oss/pcm_oss.c:1858 [inline] snd_pcm_oss_ioctl+0x9ee/0x4630 sound/core/oss/pcm_oss.c:2617 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+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] snd_pcm_group_init.__key+0x0/0x40 ... acquired at: mark_usage kernel/locking/lockdep.c:4305 [inline] __lock_acquire+0x9ee/0x6a40 kernel/locking/lockdep.c:4791 lock_acquire+0x160/0x6e0 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+0x770/0x9a0 kernel/time/timer.c:1757 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1770 __do_softirq+0x388/0x748 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/0xe0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu+0x200/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:631 arch_local_irq_restore arch/x86/include/asm/paravirt.h:653 [inline] kfree+0x140/0x210 mm/slab.c:3759 tomoyo_path_perm+0x475/0x5a0 security/tomoyo/file.c:842 security_inode_getattr+0xc0/0x140 security/security.c:1279 vfs_getattr fs/stat.c:121 [inline] vfs_statx+0x118/0x380 fs/stat.c:206 vfs_lstat include/linux/fs.h:3131 [inline] __do_sys_newlstat fs/stat.c:374 [inline] __se_sys_newlstat fs/stat.c:368 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:368 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 stack backtrace: CPU: 1 PID: 8338 Comm: systemd-udevd 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+0xa5d/0xde0 kernel/locking/lockdep.c:3817 check_usage_forwards kernel/locking/lockdep.c:2470 [inline] mark_lock_irq kernel/locking/lockdep.c:3980 [inline] mark_lock+0x111b/0x1e20 kernel/locking/lockdep.c:4408 mark_usage kernel/locking/lockdep.c:4305 [inline] __lock_acquire+0x9ee/0x6a40 kernel/locking/lockdep.c:4791 lock_acquire+0x160/0x6e0 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+0x770/0x9a0 kernel/time/timer.c:1757 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1770 __do_softirq+0x388/0x748 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/0xe0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu+0x200/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:631 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:653 [inline] RIP: 0010:kfree+0x140/0x210 mm/slab.c:3759 Code: 48 89 df 4c 89 e6 4c 89 fa e8 9c 67 00 00 84 c0 74 1f 41 f7 c6 00 02 00 00 75 2a 48 83 3d df 36 bd 08 00 74 2f 4c 89 f7 57 9d <0f> 1f 44 00 00 eb 72 48 89 df 4c 89 e6 e8 be 00 00 00 41 f7 c6 00 RSP: 0018:ffffc90016147c40 EFLAGS: 00000282 RAX: 0000000000001013 RBX: ffff8880aa040100 RCX: ffff8880534ca300 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000282 RBP: 0000000000000000 R08: ffffffff817ec230 R09: ffffffff88800e30 R10: ffffffff88a00000 R11: ffffffff88a00748 R12: ffff88809bd90040 R13: 00fffe0000000200 R14: 0000000000000282 R15: ffffffff83902d05 tomoyo_path_perm+0x475/0x5a0 security/tomoyo/file.c:842 security_inode_getattr+0xc0/0x140 security/security.c:1279 vfs_getattr fs/stat.c:121 [inline] vfs_statx+0x118/0x380 fs/stat.c:206 vfs_lstat include/linux/fs.h:3131 [inline] __do_sys_newlstat fs/stat.c:374 [inline] __se_sys_newlstat fs/stat.c:368 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:368 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f509011d335 Code: 69 db 2b 00 64 c7 00 16 00 00 00 b8 ff ff ff ff c3 0f 1f 40 00 83 ff 01 48 89 f0 77 30 48 89 c7 48 89 d6 b8 06 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 03 f3 c3 90 48 8b 15 31 db 2b 00 f7 d8 64 89 RSP: 002b:00007ffe41fa35f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000006 RAX: ffffffffffffffda RBX: 0000562063730650 RCX: 00007f509011d335 RDX: 00007ffe41fa3630 RSI: 00007ffe41fa3630 RDI: 000056206372f650 RBP: 00007ffe41fa36f0 R08: 00007f50903dc1c8 R09: 0000000000001010 R10: 0000000000000110 R11: 0000000000000246 R12: 000056206372f650 R13: 000056206372f65c R14: 00005620637219c5 R15: 00005620637219cc