From patchwork Mon Jul 30 11:03:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 143124 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3933137ljj; Mon, 30 Jul 2018 04:03:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdUFIrpPH2ar1E3FbBacZgqfhp2cnAzABVM8JkAPEcsoFATYD/W7jjyRmAZnicRuwHvjnlR X-Received: by 2002:adf:a401:: with SMTP id d1-v6mr17100609wra.121.1532948612911; Mon, 30 Jul 2018 04:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532948612; cv=none; d=google.com; s=arc-20160816; b=E8e3p7+KwNNUZxePf+sg3oPhEJRyXkJypHRkvq2+0LHI+6zqCmO2mmbVTDgUOfAAtS niW214wytmjRAMJUC8PZFSbTQvM7GvBxNxFjdoQlW1U9r7/SWqelB1hmqvBXTFavx0Xu dqwEyGLyT6VS5TDHNORczHpoHvGKlhdDxbnvfbGeAvCwzvE1Z8/rKxMUfYckuL9vQ83a x+D/f5TOS5qwPIHy7QSB1w/WYp23gYQ0+8K5cmxT9Qb/RgGRTw2tg2fepMc43YALdGFc a3Y0UCAGRwUQYK5lHRYoRdORkPsEO4VB6sdf6FC1HpGuw0A0FJCepF+pz9C9mf2hNWuz fcow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=m7DqYECFrpkW+85kNqTAIOjMeOUd3+naoF0ViVSzZ7g=; b=S3tjkitsAfNAA8n+JJdwITE8v+ZIpb2PbkRZVSEjtD+x8TCac8AMh390z2s9kOtUYo EMM7n71f1qccsR5VZuj/3K5LeGOXrIXL2iyaGJ2I2cjvuydg1yYHn4z4alSS5EPdno2J tULR1q3sQ5xULJBNu2ew1z6yaubswLtq/BiRdE78FQebCbl6D/sTSWGKfwcXZeWcLOdt AGAfbaB3CBZg4hjI5XGwoTh797M3xtKcEaXC7bM16YD5QT/5ipaO934j6q0s7N3z2eJl OXvnaXqo2rdvyAq9GMF7Tf1u7GGmjunlNTsLpxsd2Y9AlpqT+K5amP8VlLFGKV8dlU7N Vqnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=NBoopelC; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id s145-v6si9359801wme.93.2018.07.30.04.03.32; Mon, 30 Jul 2018 04:03:32 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=NBoopelC; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 955A02677AA; Mon, 30 Jul 2018 13:03:31 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0FBBA2677A3; Mon, 30 Jul 2018 13:03:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id C19B72677AC for ; Mon, 30 Jul 2018 13:03:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=duNHbo8AqVT7gKCHpjoAJr9B1eUEBKNbKm/+ii0wqg4=; b=NBoopelCZvWf /7miE+5YdS+9mjhpeKFYFD4gZZcTn4JNoCgpsKaztkvOusDt1//cu+MXENjzVvBKjBLi/6jfK8+tl /FfwmfkZfZddmyKZLf4Nq104U1mYrYHhSZRgDzbu4TfYYKObEhEtbpRbkI/dq/djPnvYI+pI2qIuY OzKZQ=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fk5xR-00053s-F7; Mon, 30 Jul 2018 11:03:21 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 388881124216; Mon, 30 Jul 2018 12:03:21 +0100 (BST) From: Mark Brown To: Gustavo A. R. Silva In-Reply-To: <20180726204910.GA1635@embeddedor.com> Message-Id: <20180730110321.388881124216@debutante.sirena.org.uk> Date: Mon, 30 Jul 2018 12:03:21 +0100 (BST) Cc: Barry Song , alsa-devel@alsa-project.org, "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org, Takashi Iwai , stable@vger.kernel.org, Liam Girdwood , Mark Brown , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] Applied "ASoC: sirf: Fix potential NULL pointer dereference" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: sirf: Fix potential NULL pointer dereference has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From ae1c696a480c67c45fb23b35162183f72c6be0e1 Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Thu, 26 Jul 2018 15:49:10 -0500 Subject: [PATCH] ASoC: sirf: Fix potential NULL pointer dereference There is a potential execution path in which function platform_get_resource() returns NULL. If this happens, we will end up having a NULL pointer dereference. Fix this by replacing devm_ioremap with devm_ioremap_resource, which has the NULL check and the memory region request. This code was detected with the help of Coccinelle. Cc: stable@vger.kernel.org Fixes: 2bd8d1d5cf89 ("ASoC: sirf: Add audio usp interface driver") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown --- sound/soc/sirf/sirf-usp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sirf/sirf-usp.c b/sound/soc/sirf/sirf-usp.c index 77e7dcf969d0..d70fcd4a1adf 100644 --- a/sound/soc/sirf/sirf-usp.c +++ b/sound/soc/sirf/sirf-usp.c @@ -370,10 +370,9 @@ static int sirf_usp_pcm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, usp); mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap(&pdev->dev, mem_res->start, - resource_size(mem_res)); - if (base == NULL) - return -ENOMEM; + base = devm_ioremap_resource(&pdev->dev, mem_res); + if (IS_ERR(base)) + return PTR_ERR(base); usp->regmap = devm_regmap_init_mmio(&pdev->dev, base, &sirf_usp_regmap_config); if (IS_ERR(usp->regmap))