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


Groups > linux.kernel > #1294833

Re: [PATCH 2/2] pci: Update VPD size with correct length

From Alexander Duyck <alexander.duyck@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] pci: Update VPD size with correct length
Date 2015-12-18 15:10 +0100
Message-ID <qH3Tk-6DX-9@gated-at.bofh.it> (permalink)
References <qGYJY-3eE-3@gated-at.bofh.it> <qGYJY-3eE-13@gated-at.bofh.it> <qH3zZ-6ie-59@gated-at.bofh.it> <qH3JE-6lu-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Dec 18, 2015 at 5:57 AM, Hannes Reinecke <hare@suse.de> wrote:
> On 12/18/2015 02:49 PM, Alexander Duyck wrote:
>>
>> On Fri, Dec 18, 2015 at 12:35 AM, Hannes Reinecke <hare@suse.de> wrote:
>>>
>>> PCI-2.2 VPD entries have a maximum size of 32k, but might actually
>>> be smaller than that. To figure out the actual size one has to read
>>> the VPD area until the 'end marker' is reached.
>>> Trying to read VPD data beyond that marker results in 'interesting'
>>> effects, from simple read errors to crashing the card. And to make
>>> matters worse not every PCI card implements this properly, leaving
>>> us with no 'end' marker or even completely invalid data.
>>> This path modifies the size of the VPD attribute to the available
>>> size, or set it to '0' if no valid data could be read.
>>
>>
>> This isn't what I had in mind.  There is no need to add an f0 version
>> of the size function.  The size for all functions other than function
>> 0 when the F0 flag is set is 0.  We aren't going to be reading their
>> VPD, we only read the VPD region of function 0.
>>
> Ah. (I'm a bit confused about the proposed action for VPD other than
> function 0).
> So the idea here is to _disallow_ access to VPDs from functions other than
> '0' unless these functions have different PCI IDs?

If you take a look at the F0 functions what they do is bypass the VPD
of the functions other than function 0.  As such setting the size to 0
should really have no effect since the VPD of the function isn't
actually read if the F0 flag is set.

- Alex
--
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 | NextPrevious in thread | Next 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