Skip to content

Commit b7d5dbe

Browse files
sebottZhengShunQian
authored andcommitted
s390/pci: fix out of bounds access during irq setup
commit 866f357 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: [email protected] Signed-off-by: Sebastian Ott <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6e90af1 commit b7d5dbe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/s390/pci/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
412412
hwirq = 0;
413413
for_each_pci_msi_entry(msi, pdev) {
414414
rc = -EIO;
415+
if (hwirq >= msi_vecs)
416+
break;
415417
irq = irq_alloc_desc(0); /* Alloc irq on node 0 */
416418
if (irq < 0)
417419
goto out_msi;

0 commit comments

Comments
 (0)