mbox series

[SRU,F,G,0/1] s390x/pci: do not allow to create more pci functions than configured via CONFIG_PCI_NR_FUNCTIONS (LP: 1874057)

Message ID 20200427185554.62453-1-frank.heimes@canonical.com
Headers show
Series s390x/pci: do not allow to create more pci functions than configured via CONFIG_PCI_NR_FUNCTIONS (LP: 1874057) | expand

Message

Frank Heimes April 27, 2020, 6:55 p.m. UTC
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]

* https://bugs.launchpad.net/ubuntu-z-systems/+bug/1874057/+attachment/5357850/+files/0001-s390-pci-Fix-zpci_alloc_domain-over-allocation-for-focal.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 this applied to focal master-next

* and this patch got upstream accepted with kernel v5.7-rc1, hence on the long term it should be in 'gorilla'

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

 arch/s390/include/asm/pci.h |  1 +
 arch/s390/pci/pci.c         | 40 +++++++++++++++++++++++++------------
 2 files changed, 28 insertions(+), 13 deletions(-)

Comments

Seth Forshee April 30, 2020, 9:47 p.m. UTC | #1
On Mon, Apr 27, 2020 at 08:55:53PM +0200, frank.heimes@canonical.com wrote:
> 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]
> 
> * https://bugs.launchpad.net/ubuntu-z-systems/+bug/1874057/+attachment/5357850/+files/0001-s390-pci-Fix-zpci_alloc_domain-over-allocation-for-focal.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 this applied to focal master-next
> 
> * and this patch got upstream accepted with kernel v5.7-rc1, hence on the long term it should be in 'gorilla'

This patch is from 5.7-rc1, but it lacks the upstream provenance. Please
use 'git cherry-pick -x' to include this information.

This patch is not required for unstable, which is already based on
5.7-rc.

Thanks,
Seth
Frank Heimes May 5, 2020, 10:12 a.m. UTC | #2
Hi Seth,
yes, I've added a comment to the justification that it got upstream
accepted wit 5.7-rc1 (that's usually the 1st thing I check).
With that it should automatically land (at some point in time) in 'gorilla',
but since gorilla's kernel is as of today still based on the focal, I've
added 'gorilla' to this request, too. But feel free to drop it if not
needed ...

And apologize that I forgot the provenance - using 'git cherry-pick -x'
indeed largely adds it automatically,
but in this case I needed to use 'git am' since a backport was needed,
because the upstream commit didn't applied cleanly while trying to
cherry-pick.
(And I think there is no 'git am -x' ...)

Anyway, I'll submit a v2 shortly with proper provenance of the backport ...

Thx for your feedback ... bye, Frank


On Thu, Apr 30, 2020 at 11:47 PM Seth Forshee <seth.forshee@canonical.com>
wrote:

> On Mon, Apr 27, 2020 at 08:55:53PM +0200, frank.heimes@canonical.com
> wrote:
> > 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]
> >
> > *
> https://bugs.launchpad.net/ubuntu-z-systems/+bug/1874057/+attachment/5357850/+files/0001-s390-pci-Fix-zpci_alloc_domain-over-allocation-for-focal.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 this applied to focal master-next
> >
> > * and this patch got upstream accepted with kernel v5.7-rc1, hence on
> the long term it should be in 'gorilla'
>
> This patch is from 5.7-rc1, but it lacks the upstream provenance. Please
> use 'git cherry-pick -x' to include this information.
>
> This patch is not required for unstable, which is already based on
> 5.7-rc.
>
> Thanks,
> Seth
>