[PATCH v3 0/2] Harden PCI resource array indexing

Philipp Stanner posted 2 patches 9 months, 1 week ago
drivers/pci/devres.c | 18 +++++++++++++++---
drivers/pci/iomap.c  | 29 +++++++++++++++++++++--------
drivers/pci/pci.c    |  6 ++++++
drivers/pci/pci.h    | 16 ++++++++++++++++
4 files changed, 58 insertions(+), 11 deletions(-)
[PATCH v3 0/2] Harden PCI resource array indexing
Posted by Philipp Stanner 9 months, 1 week ago
This is a v3, spiritually successing "v1" the original implementation of
length checking [1], and "v2", the fix squashed in by Krzyzstof [2].

Changes in v3:
  - Use PCI_NUM_RESOURCES as the devres array length and provide that as
    a bugfix to be backported. (Damien)

[1] https://lore.kernel.org/linux-pci/20250304143112.104190-2-phasta@kernel.org/
[2] https://lore.kernel.org/linux-pci/20250305075354.118331-2-phasta@kernel.org/

Philipp Stanner (2):
  PCI: Fix wrong length of devres array
  PCI: Check BAR index for validity

 drivers/pci/devres.c | 18 +++++++++++++++---
 drivers/pci/iomap.c  | 29 +++++++++++++++++++++--------
 drivers/pci/pci.c    |  6 ++++++
 drivers/pci/pci.h    | 16 ++++++++++++++++
 4 files changed, 58 insertions(+), 11 deletions(-)

-- 
2.48.1
Re: [PATCH v3 0/2] Harden PCI resource array indexing
Posted by Bjorn Helgaas 9 months, 1 week ago
On Wed, Mar 12, 2025 at 09:06:33AM +0100, Philipp Stanner wrote:
> This is a v3, spiritually successing "v1" the original implementation of
> length checking [1], and "v2", the fix squashed in by Krzyzstof [2].
> 
> Changes in v3:
>   - Use PCI_NUM_RESOURCES as the devres array length and provide that as
>     a bugfix to be backported. (Damien)
> 
> [1] https://lore.kernel.org/linux-pci/20250304143112.104190-2-phasta@kernel.org/
> [2] https://lore.kernel.org/linux-pci/20250305075354.118331-2-phasta@kernel.org/
> 
> Philipp Stanner (2):
>   PCI: Fix wrong length of devres array
>   PCI: Check BAR index for validity
> 
>  drivers/pci/devres.c | 18 +++++++++++++++---
>  drivers/pci/iomap.c  | 29 +++++++++++++++++++++--------
>  drivers/pci/pci.c    |  6 ++++++
>  drivers/pci/pci.h    | 16 ++++++++++++++++
>  4 files changed, 58 insertions(+), 11 deletions(-)

Applied to pci/devres for v6.15, thanks, Philipp!