]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:08 +0000 (09:48 +0100)
commitb6f665bd6eb07d3cf0e229f7e19fd5c8a5dbdf5a
tree7632ceade097b1622fbfef3f4791acf22892fa6f
parent394277162b231fae8f366580a9a69e8c8ff783b3
x86/irq: Ensure PI wakeup handler is unregistered before module unload

BugLink: https://bugs.launchpad.net/bugs/1951822
commit 6ff53f6a438f72998f56e82e76694a1df9d1ea2c upstream.

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: f6b3c72c2366 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/kernel/irq.c