lkml.org 
[lkml]   [2018]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 143/328] s390/pci: fix out of bounds access during irq setup
    3.16.62-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Sebastian Ott <sebott@linux.ibm.com>

    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.

    Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
    Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    arch/s390/pci/pci.c | 2 ++
    1 file changed, 2 insertions(+)

    --- a/arch/s390/pci/pci.c
    +++ b/arch/s390/pci/pci.c
    @@ -397,6 +397,8 @@ int arch_setup_msi_irqs(struct pci_dev *
    hwirq = 0;
    list_for_each_entry(msi, &pdev->msi_list, list) {
    rc = -EIO;
    + if (hwirq >= msi_vecs)
    + break;
    irq = irq_alloc_desc(0); /* Alloc irq on node 0 */
    if (irq < 0)
    goto out_msi;
    \
     
     \ /
      Last update: 2018-12-09 23:26    [W:4.044 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site