Re: [PATCH] PCI: Set VPD size conservatively

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, June 30, 2008 6:45 pm Matthew Wilcox wrote:
> On Mon, Jun 30, 2008 at 05:59:55PM -0700, Benjamin Li wrote:
> > What happens when the VPD information is corrupted?  I have an NIC which
> > functions but has a badly formed VPD (When iterating through the VPD
> > tags, you will never reach an end tag)  And because this patch will scan
> > through the entire VPD address space, it will generate an out-of-range
> > access.  Would you have any suggestions on how we could correct this?
>
> You raise a good point.  I think the call to pci_vpd_set_real_size()
> needs to be moved later after a quirk has had time to run.  Then a quirk
> can adjust the size for that board.
>
> I think this combines the best of both patches.  Each stage successively
> limits the range of data.  First, the generic code sets the maximum to
> 32k (as per spec).  Then the quirks can lower the size.  Then the generic
> code gets to run again and try to determine if the actual size is smaller.
>
> If we do it this way, a device with broken VPD (and I've seen a few
> myself) won't bring the system down, as long as it has a quirk.

Sounds like a reasonable thing to do, though it might still be a good idea to 
keep the VPD data root only in sysfs by default.  Perms can always be 
adjusted later by distro scripts etc, right?

Jesse
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux