Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1811538imm; Mon, 3 Sep 2018 10:03:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ3BEByEy1FVtmOUMliroRM1On8pPz+0w+GjEebmpSWTToDkj7ZIcfaf12RaTGVC/WHIpkZ X-Received: by 2002:a17:902:7884:: with SMTP id q4-v6mr29100180pll.174.1535994214889; Mon, 03 Sep 2018 10:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535994214; cv=none; d=google.com; s=arc-20160816; b=es20DUyPqdIq2gJbQZOwltera/kYNirjJ4NQYymkrsaOl07VSWi2Y82JTxoOlNWYvf eZHU1LP5qkVDuDYG0BE02LRXckXnDOLwror6Od65/POmI71RV/SpwBdUlKLnYDB+jKbj 3wVJZMTGTqkLuV99cU3tPt+g8qMoQeVmh01t1yU9rylBuwL0jJJlFbzaTNwYz0tDOTm1 eMSfcejg04AWwGKPKWlBcoiY47QZ0gClBUsCtysp7As8dTljlJND1uHuvV/40N642YDv nS/2Lqtpj5zao3M1d1TflDQHH/uK7Mhd6Ry3V+ABAVR1wswSzpoR6M5YvIOWDMRlJ1RQ vM2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=39npeyh9J5Qu8i/hOoryiOXlrn5pNo+XjMaUNA+rVSU=; b=07w1nNzFwevNF6bOIlsoa0H8Svag7+WkKP//TJUOGNMekblDVNnrTuEvTHogdhXan9 ZwMIYRmhvtrK6haj55wOocFnnqFVAHksJgFnH95OIGqga17srtvuh9tjf8yMNPe66eBz rq0jEnCvcu34iUcpp0b2V6fpto3p6ISLsLBQr+9HMT+IbZu0fLyblWKKvxkmS2zxOzI9 5GXukXiH6nGNHz9VsKFe4ja5hIqPXD16muaNGVdPTSgh8Ha2gNXkX4cvpW0LHdNO3z7C 07ftnWrqvILZanHCjHh6Gfb3omRkXuYiwD/o3MIHXwPP+7Fe+IRQL7cCDz2NjykhfBlT byOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v38-v6si1646887plg.179.2018.09.03.10.03.19; Mon, 03 Sep 2018 10:03:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728901AbeICVXP (ORCPT + 99 others); Mon, 3 Sep 2018 17:23:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38866 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728483AbeICVXN (ORCPT ); Mon, 3 Sep 2018 17:23:13 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 89519CEE; Mon, 3 Sep 2018 17:02:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Ott , Heiko Carstens Subject: [PATCH 4.4 73/80] s390/pci: fix out of bounds access during irq setup Date: Mon, 3 Sep 2018 18:49:51 +0200 Message-Id: <20180903164937.059414653@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903164934.171677301@linuxfoundation.org> References: <20180903164934.171677301@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Ott 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 Signed-off-by: Heiko Carstens Signed-off-by: Greg Kroah-Hartman --- arch/s390/pci/pci.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -412,6 +412,8 @@ int arch_setup_msi_irqs(struct pci_dev * hwirq = 0; for_each_pci_msi_entry(msi, pdev) { rc = -EIO; + if (hwirq >= msi_vecs) + break; irq = irq_alloc_desc(0); /* Alloc irq on node 0 */ if (irq < 0) goto out_msi;