]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: x86: Fix SRCU list traversal in kvm_fire_mask_notifiers()
authorLi RongQing <lirongqing@baidu.com>
Wed, 4 Feb 2026 09:12:06 +0000 (04:12 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Mar 2026 17:41:11 +0000 (18:41 +0100)
commitb54e4707a64be93a8ab3348e32e89817229b5eaa
tree518fc1c07e4d4a879bb4937ef6f5bc03f9e90523
parentf78e627a01bd4ec0219566d2c9c40f3c3614f875
KVM: x86: Fix SRCU list traversal in kvm_fire_mask_notifiers()

The mask_notifier_list is protected by kvm->irq_srcu, but the traversal
in kvm_fire_mask_notifiers() incorrectly uses hlist_for_each_entry_rcu().
This leads to lockdep warnings because the standard RCU iterator expects
to be under rcu_read_lock(), not SRCU.

Replace the RCU variant with hlist_for_each_entry_srcu() and provide
the proper srcu_read_lock_held() annotation to ensure correct
synchronization and silence lockdep.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260204091206.2617-1-lirongqing@baidu.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/ioapic.c