summaryrefslogtreecommitdiff
path: root/rust/zerocopy/src/pointer/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorMarco Nenciarini <mnencia@kcore.it>2026-04-17 15:24:36 +0200
committerBjorn Helgaas <bhelgaas@google.com>2026-04-27 09:47:03 -0500
commitee7471fe968d210939be9046089a924cd23c8c3b (patch)
tree9f413035241c5404cbe2a88f6c2932ebbac06aed /rust/zerocopy/src/pointer/git@git.tavy.me:linux-stable.git
parentd462c8e89e84bfb6417e6b4c88e0cb7cc747ba41 (diff)
PCI: Skip Resizable BAR restore on read error
pci_restore_rebar_state() uses the Resizable BAR Control register to decide how many BARs to restore (nbars) and which BAR each iteration addresses (bar_idx). When a device does not respond, config reads typically return PCI_ERROR_RESPONSE (~0). Both fields are 3 bits wide, so nbars and bar_idx both evaluate to 7, past the spec's valid ranges for both fields. pci_resource_n() then returns an unrelated resource slot, whose size is used to derive a nonsensical value written back to the Resizable BAR Control register. Bail out if any Resizable BAR Control read returns PCI_ERROR_RESPONSE. No further BARs are touched, which is safe because a config read that returns PCI_ERROR_RESPONSE indicates the device is unreachable and restoration is pointless. Fixes: d3252ace0bc6 ("PCI: Restore resized BAR state on resume") Signed-off-by: Marco Nenciarini <mnencia@kcore.it> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/666cac19b5daa0ab0e0ab64454e76b4d24465dbd.1776429882.git.mnencia@kcore.it
Diffstat (limited to 'rust/zerocopy/src/pointer/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions