===================================================== WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected 5.14.0-rc3-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.1/13854 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffff888016a650c0 (&new->fa_lock){.+.+}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1012 [inline] ffff888016a650c0 (&new->fa_lock){.+.+}-{2:2}, at: kill_fasync+0x13b/0x430 fs/fcntl.c:1033 and this task is already holding: ffff8881477d6948 (&timer->lock){....}-{2:2}, at: snd_timer_start1+0x5b/0x640 sound/core/timer.c:541 which would create a new lock dependency: (&timer->lock){....}-{2:2} -> (&new->fa_lock){.+.+}-{2:2} but this new dependency connects a SOFTIRQ-irq-safe lock: (&group->lock){..-.}-{2:2} ... which became SOFTIRQ-irq-safe at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1847 call_timer_fn+0xf6/0x210 kernel/time/timer.c:1419 expire_timers kernel/time/timer.c:1464 [inline] __run_timers+0x6ff/0x910 kernel/time/timer.c:1732 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1745 __do_softirq+0x372/0x783 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x21b/0x260 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 loop1+0x76f/0x892 sha256_base_do_update include/crypto/sha256_base.h:65 [inline] _sha256_update arch/x86/crypto/sha256_ssse3_glue.c:62 [inline] sha256_avx2_update+0x1c6/0x1f0 arch/x86/crypto/sha256_ssse3_glue.c:228 crypto_shash_update+0x1d9/0x2b0 crypto/shash.c:131 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:495 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:515 [inline] ima_calc_file_hash+0x16d2/0x1b00 security/integrity/ima/ima_crypto.c:572 ima_collect_measurement+0x283/0x520 security/integrity/ima/ima_api.c:252 process_measurement+0xf79/0x1ba0 security/integrity/ima/ima_main.c:330 ima_file_check+0xdb/0x130 security/integrity/ima/ima_main.c:499 do_open fs/namei.c:3376 [inline] path_openat+0x284a/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_openat fs/open.c:1236 [inline] __se_sys_openat fs/open.c:1231 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1231 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae to a SOFTIRQ-irq-unsafe lock: (&new->fa_lock){.+.+}-{2:2} ... which became SOFTIRQ-irq-unsafe at: ... lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 lease_break_callback+0x22/0x30 fs/locks.c:585 __break_lease+0xe32/0x1970 fs/locks.c:1657 break_lease include/linux/fs.h:2668 [inline] do_dentry_open+0x722/0x1020 fs/open.c:817 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: &group->lock --> &timer->lock --> &new->fa_lock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&new->fa_lock); local_irq_disable(); lock(&group->lock); lock(&timer->lock); lock(&group->lock); *** DEADLOCK *** 3 locks held by syz-executor.1/13854: #0: ffff88802bbb8568 (&tu->ioctl_lock){+.+.}-{3:3}, at: snd_timer_user_ioctl+0x4d/0x80 sound/core/timer.c:2128 #1: ffff8881477d6948 (&timer->lock){....}-{2:2}, at: snd_timer_start1+0x5b/0x640 sound/core/timer.c:541 #2: ffffffff8c7177c0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:266 the dependencies between SOFTIRQ-irq-safe lock and the holding lock: -> (&group->lock){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1847 call_timer_fn+0xf6/0x210 kernel/time/timer.c:1419 expire_timers kernel/time/timer.c:1464 [inline] __run_timers+0x6ff/0x910 kernel/time/timer.c:1732 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1745 __do_softirq+0x372/0x783 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x21b/0x260 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 loop1+0x76f/0x892 sha256_base_do_update include/crypto/sha256_base.h:65 [inline] _sha256_update arch/x86/crypto/sha256_ssse3_glue.c:62 [inline] sha256_avx2_update+0x1c6/0x1f0 arch/x86/crypto/sha256_ssse3_glue.c:228 crypto_shash_update+0x1d9/0x2b0 crypto/shash.c:131 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:495 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:515 [inline] ima_calc_file_hash+0x16d2/0x1b00 security/integrity/ima/ima_crypto.c:572 ima_collect_measurement+0x283/0x520 security/integrity/ima/ima_api.c:252 process_measurement+0xf79/0x1ba0 security/integrity/ima/ima_main.c:330 ima_file_check+0xdb/0x130 security/integrity/ima/ima_main.c:499 do_open fs/namei.c:3376 [inline] path_openat+0x284a/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_openat fs/open.c:1236 [inline] __se_sys_openat fs/open.c:1231 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1231 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae INITIAL USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0xae/0xf0 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/0x1740 sound/core/pcm_native.c:678 snd_pcm_oss_change_params_locked+0x245a/0x4390 sound/core/oss/pcm_oss.c:947 snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1091 [inline] snd_pcm_oss_get_active_substream+0x1ca/0x280 sound/core/oss/pcm_oss.c:1108 snd_pcm_oss_get_formats+0x7b/0x3a0 sound/core/oss/pcm_oss.c:1830 snd_pcm_oss_set_format sound/core/oss/pcm_oss.c:1872 [inline] snd_pcm_oss_ioctl+0xd5c/0x3910 sound/core/oss/pcm_oss.c:2644 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] snd_pcm_group_init.__key+0x0/0x40 -> (&timer->lock){....}-{2:2} { INITIAL USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_timer_notify+0x105/0x3e0 sound/core/timer.c:1087 snd_pcm_timer_notify sound/core/pcm_native.c:587 [inline] snd_pcm_post_stop sound/core/pcm_native.c:1445 [inline] snd_pcm_action_single sound/core/pcm_native.c:1221 [inline] snd_pcm_action sound/core/pcm_native.c:1302 [inline] snd_pcm_stop+0x3b8/0x4c0 sound/core/pcm_native.c:1468 snd_pcm_drop+0x16d/0x290 sound/core/pcm_native.c:2147 snd_pcm_oss_sync+0x4f4/0xee0 sound/core/oss/pcm_oss.c:1721 snd_pcm_oss_release+0x119/0x270 sound/core/oss/pcm_oss.c:2571 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] snd_timer_new.__key+0x0/0x40 ... acquired at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_timer_notify+0x105/0x3e0 sound/core/timer.c:1087 snd_pcm_timer_notify sound/core/pcm_native.c:587 [inline] snd_pcm_post_stop sound/core/pcm_native.c:1445 [inline] snd_pcm_action_single sound/core/pcm_native.c:1221 [inline] snd_pcm_action sound/core/pcm_native.c:1302 [inline] snd_pcm_stop+0x3b8/0x4c0 sound/core/pcm_native.c:1468 snd_pcm_drop+0x16d/0x290 sound/core/pcm_native.c:2147 snd_pcm_oss_sync+0x4f4/0xee0 sound/core/oss/pcm_oss.c:1721 snd_pcm_oss_release+0x119/0x270 sound/core/oss/pcm_oss.c:2571 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae the dependencies between the lock to be acquired and SOFTIRQ-irq-unsafe lock: -> (&new->fa_lock){.+.+}-{2:2} { HARDIRQ-ON-R at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 lease_break_callback+0x22/0x30 fs/locks.c:585 __break_lease+0xe32/0x1970 fs/locks.c:1657 break_lease include/linux/fs.h:2668 [inline] do_dentry_open+0x722/0x1020 fs/open.c:817 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae SOFTIRQ-ON-R at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 lease_break_callback+0x22/0x30 fs/locks.c:585 __break_lease+0xe32/0x1970 fs/locks.c:1657 break_lease include/linux/fs.h:2668 [inline] do_dentry_open+0x722/0x1020 fs/open.c:817 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae INITIAL USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_write_lock_irq include/linux/rwlock_api_smp.h:196 [inline] _raw_write_lock_irq+0xae/0xf0 kernel/locking/spinlock.c:311 fasync_remove_entry+0xff/0x1d0 fs/fcntl.c:890 lease_modify+0x4dd/0x6a0 fs/locks.c:1522 locks_remove_lease fs/locks.c:2771 [inline] locks_remove_file+0x52e/0xfd0 fs/locks.c:2796 __fput+0x2bf/0x7b0 fs/file_table.c:272 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae INITIAL READ USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 lease_break_callback+0x22/0x30 fs/locks.c:585 __break_lease+0xe32/0x1970 fs/locks.c:1657 break_lease include/linux/fs.h:2668 [inline] do_dentry_open+0x722/0x1020 fs/open.c:817 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] fasync_insert_entry.__key+0x0/0x40 ... acquired at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 snd_timer_user_ccallback+0x3ee/0x710 sound/core/timer.c:1387 snd_timer_notify1+0x19e/0x340 sound/core/timer.c:516 snd_timer_start1+0x53d/0x640 sound/core/timer.c:578 snd_timer_start sound/core/timer.c:697 [inline] snd_timer_user_start sound/core/timer.c:1985 [inline] __snd_timer_user_ioctl+0xe18/0x5ed0 sound/core/timer.c:2108 snd_timer_user_ioctl+0x5d/0x80 sound/core/timer.c:2129 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae stack backtrace: CPU: 1 PID: 13854 Comm: syz-executor.1 Not tainted 5.14.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105 print_bad_irq_dependency kernel/locking/lockdep.c:2565 [inline] check_irq_usage kernel/locking/lockdep.c:2804 [inline] check_prev_add kernel/locking/lockdep.c:3055 [inline] check_prevs_add+0x4eaa/0x5b30 kernel/locking/lockdep.c:3174 validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x4476/0x6100 kernel/locking/lockdep.c:5015 lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 snd_timer_user_ccallback+0x3ee/0x710 sound/core/timer.c:1387 snd_timer_notify1+0x19e/0x340 sound/core/timer.c:516 snd_timer_start1+0x53d/0x640 sound/core/timer.c:578 snd_timer_start sound/core/timer.c:697 [inline] snd_timer_user_start sound/core/timer.c:1985 [inline] __snd_timer_user_ioctl+0xe18/0x5ed0 sound/core/timer.c:2108 snd_timer_user_ioctl+0x5d/0x80 sound/core/timer.c:2129 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f270592e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 00000000000054a0 RDI: 0000000000000003 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007fffa1c089ef R14: 00007f270592e300 R15: 0000000000022000