Received: by 10.213.65.68 with SMTP id h4csp223656imn; Fri, 23 Mar 2018 03:16:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELu44i/QDFoGT1nPa8N3V3+sH7l9qkSHhg8P8fOpInmujOUKm4sWY2Plok11WmU3Gxy8F9d3 X-Received: by 10.99.183.15 with SMTP id t15mr20996348pgf.416.1521800186263; Fri, 23 Mar 2018 03:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521800186; cv=none; d=google.com; s=arc-20160816; b=ptajb7linLOV0aha0LgPKODO0ywYrFBhkb6tMWOtvkROzbuZ6Bd7VBVEda/KFVgVI3 lqgeO5FNgchXKPt0jwgV7XJzuH5P9cyaAcHstZb0t8agI+dHXZZ9BRL/5PtdbIQHSW0B cqqyslkiYubgAhHhqRRfleKeXNcQzmbEXjNS5dLC0miUB9wfutnPmFt9p3MVq69bHxXQ QOgCSVxONLQLe2jO26Ehh19QeXmPasseEiwOQ5996gbA1syUA4wk+k2G6UJ5InHzlowc zyJpACchrnlSdiPPVKZEoZJUXz1XukFlwLrBg32LVHp4xWOztf6MC5fOowsGzpTji6l0 qvDQ== 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=zTtO3UzXprME3bW535wUbHyEq3yPhww9IlbmwvkFx80=; b=wc4IGDk/xKRl9pdn51AqAR/Z6VocIs0bJ6/Ea889krk2dw4CebQMllssycpijzVkMv 0/4iI3i5e0G9SOmYA2H0Yh9jSl67PE2KOXTOe3MLXtTPY0W1qE/OIVwn+KzocZQ1Z8kw nA/JC8oTIiWt/++1ofVgi/sHApxKIhqzprJmL7bQbu3Q8S4a5HgBZeiRSTyvOIKS6vgC 0kQSJW6gWkehKFJ96p/YFRvDcO+hxqCmla/KYLfPTC1fP25OAztlnCk815fbqzuC8E2B 5hXjF7iy1JWGwkSNRSmnR9p328bJmRxXqz8ibDTMC/1wjjxAh94eJnyI3RlW2Le4/Aqq ahzg== 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 j127si5921338pgc.653.2018.03.23.03.16.11; Fri, 23 Mar 2018 03:16:26 -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 S933465AbeCWKPX (ORCPT + 99 others); Fri, 23 Mar 2018 06:15:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45618 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933400AbeCWKPV (ORCPT ); Fri, 23 Mar 2018 06:15:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 69C591279; Fri, 23 Mar 2018 10:15:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 41/97] wan: pc300too: abort path on failure Date: Fri, 23 Mar 2018 10:54:28 +0100 Message-Id: <20180323094159.954567569@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@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: Pan Bian [ Upstream commit 2a39e7aa8a98f777f0732ca7125b6c9668791760 ] In function pc300_pci_init_one(), on the ioremap error path, function pc300_pci_remove_one() is called to free the allocated memory. However, the path is not terminated, and the freed memory will be used later, resulting in use-after-free bugs. This path fixes the bug. Signed-off-by: Pan Bian Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/pc300too.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c @@ -347,6 +347,7 @@ static int pc300_pci_init_one(struct pci card->rambase == NULL) { pr_err("ioremap() failed\n"); pc300_pci_remove_one(pdev); + return -ENOMEM; } /* PLX PCI 9050 workaround for local configuration register read bug */