Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1294496

[PATCHv4 0/2] PCI: Safe VPD access

From Hannes Reinecke <hare@suse.de>
Newsgroups linux.kernel
Subject [PATCHv4 0/2] PCI: Safe VPD access
Date 2015-12-18 09:40 +0100
Message-ID <qGYJY-3eE-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCHv4 0/2] PCI: Safe VPD access Hannes Reinecke <hare@suse.de> - 2015-12-18 09:40 +0100
  [PATCH 2/2] pci: Update VPD size with correct length Hannes Reinecke <hare@suse.de> - 2015-12-18 09:40 +0100
    Re: [PATCH 2/2] pci: Update VPD size with correct length Alexander Duyck <alexander.duyck@gmail.com> - 2015-12-18 14:50 +0100
      Re: [PATCH 2/2] pci: Update VPD size with correct length Hannes Reinecke <hare@suse.de> - 2015-12-18 15:00 +0100
        Re: [PATCH 2/2] pci: Update VPD size with correct length Alexander Duyck <alexander.duyck@gmail.com> - 2015-12-18 15:10 +0100
          Re: [PATCH 2/2] pci: Update VPD size with correct length Hannes Reinecke <hare@suse.de> - 2015-12-18 15:20 +0100
            RE: [PATCH 2/2] pci: Update VPD size with correct length <Jordan_Hargrave@Dell.com> - 2015-12-29 06:40 +0100
              Re: [PATCH 2/2] pci: Update VPD size with correct length Alexander Duyck <alexander.duyck@gmail.com> - 2015-12-29 18:50 +0100
                RE: [PATCH 2/2] pci: Update VPD size with correct length <Jordan_Hargrave@Dell.com> - 2015-12-29 20:20 +0100
                Re: [PATCH 2/2] pci: Update VPD size with correct length Alexander Duyck <alexander.duyck@gmail.com> - 2015-12-29 21:30 +0100
  [PATCH 1/2] pci: Update VPD definitions Hannes Reinecke <hare@suse.de> - 2015-12-18 09:40 +0100

csiph-web