Skip to content

Commit d3df786

Browse files
committed
Merge: CVE-2024-46761: pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5227 JIRA: https://issues.redhat.com/browse/RHEL-59436 CVE: CVE-2024-46761 ``` pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv The hotplug driver for powerpc (pci/hotplug/pnv_php.c) causes a kernel crash when we try to hot-unplug/disable the PCIe switch/bridge from the PHB. The crash occurs because although the MSI data structure has been released during disable/hot-unplug path and it has been assigned with NULL, still during unregistration the code was again trying to explicitly disable the MSI which causes the NULL pointer dereference and kernel crash. The patch fixes the check during unregistration path to prevent invoking pci_disable_msi/msix() since its data structure is already freed. Reported-by: Timothy Pearson <tpearson@raptorengineering.com> Closes: https://lore.kernel.org/all/1981605666.2142272.1703742465927.JavaMail.zimbra@raptorengineeringinc.com/ Acked-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Shawn Anastasio <sanastasio@raptorengineering.com> Signed-off-by: Krishna Kumar <krishnak@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240701074513.94873-2-krishnak@linux.ibm.com (cherry picked from commit 335e35b) ``` Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2024-09-18 11:36 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://gitlab.com/cki-project/kernel-workflow/-/issues/new?issue%5Btitle%5D=backporter%20webhook%20issue)</small> Approved-by: Myron Stowe <mstowe@redhat.com> Approved-by: John W. Linville <linville@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents 8eaee14 + 57beb23 commit d3df786

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/pci/hotplug/pnv_php.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ static void pnv_php_disable_irq(struct pnv_php_slot *php_slot,
4040
bool disable_device)
4141
{
4242
struct pci_dev *pdev = php_slot->pdev;
43-
int irq = php_slot->irq;
4443
u16 ctrl;
4544

4645
if (php_slot->irq > 0) {
@@ -59,7 +58,7 @@ static void pnv_php_disable_irq(struct pnv_php_slot *php_slot,
5958
php_slot->wq = NULL;
6059
}
6160

62-
if (disable_device || irq > 0) {
61+
if (disable_device) {
6362
if (pdev->msix_enabled)
6463
pci_disable_msix(pdev);
6564
else if (pdev->msi_enabled)

0 commit comments

Comments
 (0)