]> git.baikalelectronics.ru Git - kernel.git/commit
x86/irq: Ensure PI wakeup handler is unregistered before module unload
authorSean Christopherson <seanjc@google.com>
Sat, 9 Oct 2021 00:11:04 +0000 (17:11 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Oct 2021 16:45:35 +0000 (12:45 -0400)
commit528e7ed32bb10a7a3be0015d4d27836240c13b41
tree667cd51701eeb10c21c48351ef4c0ebc9f76c2e3
parent70355dd4f8c892f48f826f735f62187980f4b283
x86/irq: Ensure PI wakeup handler is unregistered before module unload

Add a synchronize_rcu() after clearing the posted interrupt wakeup handler
to ensure all readers, i.e. in-flight IRQ handlers, see the new handler
before returning to the caller.  If the caller is an exiting module and
is unregistering its handler, failure to wait could result in the IRQ
handler jumping into an unloaded module.

The registration path doesn't require synchronization, as it's the
caller's responsibility to not generate interrupts it cares about until
after its handler is registered.

Fixes: f6bc7e7ea9bb ("x86/irq: Define a global vector for VT-d Posted-Interrupts")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009001107.3936588-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/irq.c