Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1614798ybv; Fri, 21 Feb 2020 00:19:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxvi4CiOyvRzkn0Y3e8eu+nsWWtCe6ZJLhrP+siljPpvijc+Lr6RoODSdEd/d0+0gKcHxGr X-Received: by 2002:aca:6543:: with SMTP id j3mr993058oiw.150.1582273165249; Fri, 21 Feb 2020 00:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273165; cv=none; d=google.com; s=arc-20160816; b=oHXbP9WtLbSreXt5bpTdV57CtevUOgM+I1sK/2dP3q8zy+0AU//4g0Kv8/Js3WpDuz ukMbt7OM8yhq9YMHpyDAyGNbZySh7xm9wOoTzLS+dTnh2kVbuDbXmIrCeToCMqtT7kWT EbZYw8kHqy6bKuZYlDG4W5R3FIh9u7hrJRQILuLad+wWPDneG2ei5OR55bnuXCQdOyWe GIdAeJsqeOgjYJmBjzP2dvCfdPgWqPTK8DhsPXjfn3/lKpGrawJeT2pb8FAFPLMCjL6n m/SFCkjpSTThN8kSMwFyRwhL0W4YZ4Ksbrpi2WrjeMJp7etUZL8j5q9+mubqoB7btj6L FnDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nlHEAbUK9pV2Nc3wxNWTKCjdRuCcRDNtGLqdAoVSeQE=; b=bPK/5z4QSgCyW2bclcALHpAsKVeHQbg5kND529txP0bkrJBgkjFiujjps9LpbUuevE 2UdrXNd3Zvs0TQRTLnSdrEoxVCmLFzENmSKfZ4F5TaI4VRmcRZVId5pByhdg3FeMfyVv P+SaUl+wH94PaVxZwXpgD+LmtlVfApy+HmnzLIw2SfHKcspfLDKNPr66ocBDlyvaguHb 3w6p1onnMcGuMVRX9pjVBAygkyI3Hq1uy1LTv2kEC/ofuCANNHyX2WhjY77np3nh4V0P eK33vP4NeV/J1YtiE2fG0gWtdkf2FNak7Z03gXxa+8X/IHghO53FM/AM+0BNFqegpEDI Iu6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uqgFobik; 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 i12si482970oik.171.2020.02.21.00.19.13; Fri, 21 Feb 2020 00:19:25 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=uqgFobik; 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 S2387852AbgBUISb (ORCPT + 99 others); Fri, 21 Feb 2020 03:18:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:56414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387548AbgBUIS1 (ORCPT ); Fri, 21 Feb 2020 03:18:27 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53D6324692; Fri, 21 Feb 2020 08:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273106; bh=jEj5vj6rTmN0KRMTw6UUhT9B/y/Cgc6kZ9BcXBDAkvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uqgFobikW1irbmDhX8FyTxhAbipQPeHAcWJ89OD2ebfEXEA4SDQL1yhrr4P0RWQag NVeNo05H+xH/21g0caAtdmPiSm7TNIi8K8Wp4ux8XcolOitQlqhYAoKkbHrsCSqG04 lyKmXLTCJD5n5zZQbOdDJfoO4DN+9nNW2weoR07s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Franky Lin , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 014/191] brcmfmac: Fix use after free in brcmf_sdio_readframes() Date: Fri, 21 Feb 2020 08:39:47 +0100 Message-Id: <20200221072252.894264114@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 216b44000ada87a63891a8214c347e05a4aea8fe ] The brcmu_pkt_buf_free_skb() function frees "pkt" so it leads to a static checker warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:1974 brcmf_sdio_readframes() error: dereferencing freed memory 'pkt' It looks like there was supposed to be a continue after we free "pkt". Fixes: 4754fceeb9a6 ("brcmfmac: streamline SDIO read frame routine") Signed-off-by: Dan Carpenter Acked-by: Franky Lin Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 5c3b62e619807..e0211321fe9e8 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -1934,6 +1934,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) BRCMF_SDIO_FT_NORMAL)) { rd->len = 0; brcmu_pkt_buf_free_skb(pkt); + continue; } bus->sdcnt.rx_readahead_cnt++; if (rd->len != roundup(rd_new.len, 16)) { -- 2.20.1