public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] PCI: Fix NULL pointer access in pci_store_saved_state()
@ 2026-04-04  8:52 Krishna Chaitanya Chundru
  2026-04-04  8:52 ` [PATCH 1/2] PCI: Add pcie_link_is_active() to determine if the link is active Krishna Chaitanya Chundru
  2026-04-04  8:53 ` [PATCH 2/2] PCI: Fix NULL pointer access in pci_store_saved_state() Krishna Chaitanya Chundru
  0 siblings, 2 replies; 4+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-04-04  8:52 UTC (permalink / raw)
  To: Bjorn Helgaas, manivannan.sadhasivam
  Cc: linux-pci, linux-kernel, Krishna Chaitanya Chundru,
	Shawn Anastasio, Timothy Pearson, Lukas Wunner

If the PCIe link goes down while pci_save_state() is in progress, reads
from the device configuration space may return invalid values(all 0xF's).

This can lead to saving corrupted or inconsistent capability state and
subsequent memory corruption. The issue is not limited to a specific
capability type and may occur at any point during the save process.

One example is, while saving VC extended capability save path
(pci_save_vc_state() / pci_vc_do_save_buffer()) then interprets all-1s
capability fields as valid and ends up writing far beyond the allocated
pci_cap_saved_state buffer, corrupting the pci_dev->saved_cap_space list.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
Krishna Chaitanya Chundru (2):
      PCI: Add pcie_link_is_active() to determine if the link is active
      PCI: Fix NULL pointer access in pci_store_saved_state()

 drivers/pci/hotplug/pciehp.h      |  1 -
 drivers/pci/hotplug/pciehp_ctrl.c |  2 +-
 drivers/pci/hotplug/pciehp_hpc.c  | 35 ++++-------------------------------
 drivers/pci/pci.c                 | 38 +++++++++++++++++++++++++++++++++++---
 drivers/pci/pci.h                 |  1 +
 5 files changed, 41 insertions(+), 36 deletions(-)
---
base-commit: 7ca6d1cfec80ebe46cc063f3284c5896c344d9a1
change-id: 20260303-fix_pci_access-c03b3b64ddbc

Best regards,
-- 
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-05  8:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-04  8:52 [PATCH 0/2] PCI: Fix NULL pointer access in pci_store_saved_state() Krishna Chaitanya Chundru
2026-04-04  8:52 ` [PATCH 1/2] PCI: Add pcie_link_is_active() to determine if the link is active Krishna Chaitanya Chundru
2026-04-04  8:53 ` [PATCH 2/2] PCI: Fix NULL pointer access in pci_store_saved_state() Krishna Chaitanya Chundru
2026-04-05  8:02   ` Lukas Wunner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox