s390/pci: fix out of bounds access during irq setup
authorSebastian Ott <sebott@linux.ibm.com>
Mon, 13 Aug 2018 09:26:46 +0000 (11:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:20:10 +0000 (09:20 +0200)
commit664a64bd6df6028a2bbd3755959aa0916649dac2
treeb13d9f915d8769ed88df20f3502d89098d1367bd
parentd519aab009a132f66eac44f4d6ae32b615e97859
s390/pci: fix out of bounds access during irq setup

commit 866f3576a72b2233a76dffb80290f8086dc49e17 upstream.

During interrupt setup we allocate interrupt vectors, walk the list of msi
descriptors, and fill in the message data. Requesting more interrupts than
supported on s390 can lead to an out of bounds access.

When we restrict the number of interrupts we should also stop walking the
msi list after all supported interrupts are handled.

Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/pci/pci.c