Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp876584pxk; Thu, 17 Sep 2020 20:03:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRgrTrK6+fPDOjUuAQiQniGXuGYPo1rFURjTZRWmRnQH+IaPaBetsKObd3lfHd4IhdXevp X-Received: by 2002:a50:fb0e:: with SMTP id d14mr37674666edq.172.1600398216196; Thu, 17 Sep 2020 20:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398216; cv=none; d=google.com; s=arc-20160816; b=zo857uDVYcUcUGl1vChv04vA6HGz+BjdFfLOJ/59TgIvSaFe/MPGH73HGUNVUDihQl 5s4QQmMIkA/o/2NEPXH4z0mRh9Xm42rJclyWoKj/ja8MECMNb4AymDL3NCRPP7LYqsId dHTae5BmljgYn3OiFcAfTwrPqmN3B8pUPgJQ3NbcN8+FHrxRnVT59lqK/yLvDCKss9c/ 6qc0UtLLp8x9yvMq4Zr1Lv3/LF3c1cQFCHwG/hnoeP837psknzCrg8VnUBHn92q66Psh BrHZ46V9R8a0KlqsKHqz5YccuFsV1Z0zXyLr7b1fKMDuuAdIynK9hf0L5xAWeN2kCaYi Ll8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vevQ1tV4qz6Q4wZCmwYGwdBMlpWKmYRKHJFcMyu9jNQ=; b=qp9rtY4Oxow+lBsxl9NAApiS1EUdKxsDyOxVppkqEXfZ12bKBp5ETl4rbM02Qj1t9d v44v904I4QZRBXpm8z+Tl3wa5Kni4/0p/8ZfYfhZCOxJIvaFVw/8oSRHXBShcV/OMkvK 9eLU5caAqAmr+P/FdTWeO+4/1gA3le+FRsBT2T/9OI5Fthtyb2eB0syGL5PFgWkGdMzt 8UXAObay2Ne2LsiOnk0sB3vwl1cm9PKVpXwqnpdtBrpxHiWwi7Fwh47F0ojCoUsP9jwx KAx5k3wL5Hwzq72isb0946KJaVY3hAxm7MVO3AS4s76xk2DqWIBKh990bjozsq6OXMHX 0xMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bMNFlgtD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz19si1597692ejb.241.2020.09.17.20.03.13; Thu, 17 Sep 2020 20:03:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bMNFlgtD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbgIRDBF (ORCPT + 99 others); Thu, 17 Sep 2020 23:01:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:53712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbgIRCF0 (ORCPT ); Thu, 17 Sep 2020 22:05:26 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B109A2376F; Fri, 18 Sep 2020 02:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394725; bh=4aJ98UjtJt7kaQkL7jPD6T/htJNsIC50/6P6Y5BPc+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bMNFlgtD90B2gjNKS2bGsLGn6y9ExK/hlnIIks07vZQm8Cotnnw2zzZX5vwBTzTyB WuwzKXMhgP8gEPl1fh9V1+33kytE6VXKattDCGXfXrSqqb1gSrbsi6LsxW1c6p5aIt M+m/2DN3ish6yJDlTwhI1AHPOJ8EZJMEbmH3r7IE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Raveendran Somu , Chi-hsien Lin , Kalle Valo , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 208/330] brcmfmac: Fix double freeing in the fmac usb data path Date: Thu, 17 Sep 2020 21:59:08 -0400 Message-Id: <20200918020110.2063155-208-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Raveendran Somu [ Upstream commit 78179869dc3f5c0059bbf5d931a2717f1ad97ecd ] When the brcmf_fws_process_skb() fails to get hanger slot for queuing the skb, it tries to free the skb. But the caller brcmf_netdev_start_xmit() of that funciton frees the packet on error return value. This causes the double freeing and which caused the kernel crash. Signed-off-by: Raveendran Somu Signed-off-by: Chi-hsien Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585124429-97371-3-git-send-email-chi-hsien.lin@cypress.com Signed-off-by: Sasha Levin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index eadc64454839d..3d36b6ee158bb 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -2149,8 +2149,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) brcmf_fws_enq(fws, BRCMF_FWS_SKBSTATE_DELAYED, fifo, skb); brcmf_fws_schedule_deq(fws); } else { - bphy_err(drvr, "drop skb: no hanger slot\n"); - brcmf_txfinalize(ifp, skb, false); + bphy_err(drvr, "no hanger slot available\n"); rc = -ENOMEM; } brcmf_fws_unlock(fws); -- 2.25.1