From: Hannes Reinecke <hare@suse.de>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
Michal Kubecek <mkubecek@suse.com>,
"Shane M. Seymour" <shane.seymour@hpe.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Hannes Reinecke <hare@suse.de>
Subject: [PATCHv4 0/2] PCI: Safe VPD access
Date: Fri, 18 Dec 2015 09:35:17 +0100 [thread overview]
Message-ID: <1450427719-29619-1-git-send-email-hare@suse.de> (raw)
PCI VPD suffers from two problems: it has a very rudimentary interface
and it relies on correctly formatted data. And essentially it provides
a direct channel into the card hardware. In other words, plenty of
chances to mess things up.
With the original implementation we would just read the VPD space,
blissfully ignorant of the data formatting of the VPD data. This
would work if the VPD space happens to be properly implemented.
However, I've had several reports where a simple 'cat' on the vpd
attribute would return garbage (if you're lucky), trigger a timeout
with a kernel warning (which actually triggered this patchset), or
hang your machine (if you're really unlucky).
So this patchset validates the VPD data, setting the VPD attribute to
the correct size or disabling VPD access altogether if no valid data
is found.
Changes to v3:
- Do not calculate size for pci function devices
- Do not disable the attribute on error
- move size calculation into the pci_vpd_ops structure
Hannes Reinecke (2):
pci: Update VPD definitions
pci: Update VPD size with correct length
drivers/pci/access.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/pci/pci.h | 1 +
include/linux/pci.h | 27 ++++++++++++++++--
3 files changed, 107 insertions(+), 2 deletions(-)
--
1.8.5.6
next reply other threads:[~2015-12-18 8:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-18 8:35 Hannes Reinecke [this message]
2015-12-18 8:35 ` [PATCH 1/2] pci: Update VPD definitions Hannes Reinecke
2015-12-18 8:35 ` [PATCH 2/2] pci: Update VPD size with correct length Hannes Reinecke
2015-12-18 13:49 ` Alexander Duyck
2015-12-18 13:57 ` Hannes Reinecke
2015-12-18 14:02 ` Alexander Duyck
2015-12-18 14:14 ` Hannes Reinecke
2015-12-29 5:29 ` Jordan_Hargrave
2015-12-29 17:48 ` Alexander Duyck
2015-12-29 19:01 ` Jordan_Hargrave
2015-12-29 20:26 ` Alexander Duyck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450427719-29619-1-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=alexander.duyck@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mkubecek@suse.com \
--cc=shane.seymour@hpe.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).