> -----Original Message----- > From: Rex Zhu [mailto:Rex.Zhu@xxxxxxx] > Sent: Monday, June 4, 2018 9:47 PM > To: bhelgaas@xxxxxxxxxx; Daenzer, Michel <Michel.Daenzer@xxxxxxx>; > Deucher, Alexander <Alexander.Deucher@xxxxxxx>; linux- > pci@xxxxxxxxxxxxxxx > Cc: Zhu, Rex <Rex.Zhu@xxxxxxx> > Subject: [PATCH 1/2] PCI: Avoid access memory outside the resource > window > > change ">" to ">=" to avoid access beyond the actual length of io memory. > > Signed-off-by: Rex Zhu <Rex.Zhu@xxxxxxx> Series is: Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx> > --- > drivers/pci/rom.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index 374a334..a5c6016 > 100644 > --- a/drivers/pci/rom.c > +++ b/drivers/pci/rom.c > @@ -108,7 +108,7 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void > __iomem *rom, size_t size) > length = readw(pds + 16); > image += length * 512; > /* Avoid iterating through memory outside the resource > window */ > - if (image > rom + size) > + if (image >= rom + size) > break; > } while (length && !last_image); > > -- > 1.9.1