[SRU][F][G][PATCH v2 0/1] s390x/pci: do not allow to create more pci functions than configured via CONFIG_PCI_NR_FUNCTIONS

frank.heimes at canonical.com frank.heimes at canonical.com
Tue May 5 10:22:08 UTC 2020


Buglink: https://bugs.launchpad.net/bugs/1874057

SRU Justification:

[Impact]

* PCI Functions with UIDs >128 are currently not accounted correctly in the s390x/pci (zPCI) code.

* Furthermore, the code allows that more than CONFIG_PCI_NR_FUNCTIONS are created.

* This can lead to issues with data structures which were only allocated for CONFIG_PCI_NR_FUNCTIONS.

[Fix]

* Backport: https://launchpadlibrarian.net/478235080/0001-s390-pci-Fix-zpci_alloc_domain-over-allocation.patch

[Test Case]

* Set the kernel parameter CONFIG_PCI_NR_FUNCTIONS to a specific (reasonablly low) number.

* And check if more PCI functions can be created than specified by CONFIG_PCI_NR_FUNCTIONS (e.g. using a RoCE adapter) and watch for kernel message 'Adding PCI function ... failed'

[Regression Potential] 

* There is regression potential can be considered as low, since:

* the zPCI cards are less wide spread than for example ccw adapters on s390x

* the fix got already upstream accepted in 5.7, hence upstream reviewed, too

* the modifications span just two files and both are s390x arch specific

[Other Info]

* The above patch (file) is based on commit 969ae01bab2fe938b4c8324836038b5ac1c78fac ("s390/pci: Fix zpci_alloc_domain() over allocation"), but this backport was needed for getting it applied to focal master-next

* The commit itself got upstream accepted with kernel v5.7-rc1, hence should automatically land in 'gorilla', but since gorilla is still on a 5.4 kernel adding 'G' to this SRU

Niklas Schnelle (1):
  s390/pci: Fix zpci_alloc_domain() over allocation

 arch/s390/include/asm/pci.h |  1 +
 arch/s390/pci/pci.c         | 34 ++++++++++++++++++++--------------
 2 files changed, 21 insertions(+), 14 deletions(-)

-- 
2.25.1




More information about the kernel-team mailing list