PCI/VPD: Reject resource tags with invalid size
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 15 Jul 2021 21:59:57 +0000 (16:59 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 9 Aug 2021 18:42:56 +0000 (13:42 -0500)
commit6303049d16f0e69d0449c3c80d0e3695d4f02f94
treed38ac779a18ed87de625612cd2ab8149e4525972
parent4e0d77f8e831fcbe86a02dd0ead12d9c8c057700
PCI/VPD: Reject resource tags with invalid size

VPD is limited in size by the 15-bit VPD Address field in the VPD
Capability.  Each resource tag includes a length that determines the
overall size of the resource.  Reject any resources that would extend past
the maximum VPD size.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
drivers/pci/vpd.c