]> www.infradead.org Git - users/jedix/linux-maple.git/commit
pci: Limit VPD length for megaraid_sas adapter
authorBabu Moger <babu.moger@oracle.com>
Fri, 6 Nov 2015 22:11:01 +0000 (17:11 -0500)
committerAllen Pais <allen.pais@oracle.com>
Fri, 20 Nov 2015 15:25:21 +0000 (20:55 +0530)
commit4ae3069c143f8897868a9e801537ce3390a8eab0
tree755d31c3b871f832032f74ec8572aabc73aa58bf
parenta33b149f6d889b2d32fab6371a329fa167d0f953
pci: Limit VPD length for megaraid_sas adapter

Reading or Writing of PCI VPD data causes system panic.
We saw this problem by running "lspci -vvv" in the beginning.
However this can be easily reproduced by running
 cat /sys/bus/devices/XX../vpd

VPD length has been set as 32768 by default. Accessing vpd
will trigger read/write of 32k. This causes problem as we
could read data beyond the VPD end tag. Behaviour is un-
predictable when this happens. I see some other adapter doing
similar quirks(commit bffadffd43d4 ("PCI: fix VPD limit quirk
for Broadcom 5708S"))

I see there is an attempt to fix this right way.
https://patchwork.ozlabs.org/patch/534843/ or
https://lkml.org/lkml/2015/10/23/97

Tried to fix it this way, but problem is I dont see the proper
start/end TAGs(at least for this adapter) at all. The data is
mostly junk or zeros. This patch fixes the issue by setting the
vpd length to 0x80.

Signed-off-by: Babu Moger <babu.moger@oracle.com>
Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com>
Orabug: 22104511

Changes since v2 -> v3
Changed the vpd length from 0 to 0x80 which leaves the
option open for someone to read first few bytes.

Changes since v1 -> v2
Removed the changes in pci_id.h. Kept all the vendor
ids in quirks.c
(cherry picked from commit 8b95aa6b57dd64c4f36fa74026afe62de8c3afbb)
drivers/pci/quirks.c