Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4634487pxj; Wed, 12 May 2021 09:42:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpAntAKmUIOgsgFfyEph0keXcZ7Yax8REHdWAAp3HrZkYitY5mOV187l9EYs+uZ4Gu4M0y X-Received: by 2002:ac2:43b4:: with SMTP id t20mr24878349lfl.373.1620837753493; Wed, 12 May 2021 09:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837753; cv=none; d=google.com; s=arc-20160816; b=wBzFGf7cahO9LBRSGbycidNJxGNpAUJzR7shzaIZrx0vlMKpKnBW9MD7oFmZR2HqH/ qUxFdHthlYWnOsoi7PcKQjFrbfuNUSdCHQhOxPwlI/3O/M44PcVqjgO3JfgA43R978+F OLlI8fZ/h2bAFrNUtB8qjPx5ABH2KBKHYFWDiEJPy+mrOG/613e910K88xZi5x8U8LZp J6cw2WUZocBPCNCRqG3mhdGkIGjRLp1UACPLfFtBxZnXWO9kCWUp2NpZ2D7tA/DKbwI2 XfcqTv7vdu1CV5A4skzGexmAWQ3GrRHJ91dRW3SaotAMt2K7EHV+FbQEriMvwTm1Qvr5 rYjw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Qhr+lfwvkjUJIZEFJNU+uluBupU7i08AGfmqQoJpvEQ=; b=toFV5iCEgybTfIBmCZNxfOt80L5FuZj2nSykb9APCiBbkaLZ7INqc/guh3XvUUN6dh rsvAEmxgJnKwWtShiK9Vb60yZVVWnRcBaUBmKAoiw5wSggFkkdaJOQeVo8D/YyuavX2W Cvc9AmRvePk+InYT1mSRdhyUzzQifKlE+0kvzOxF0PlajTVw16+AYghEX/Z6z+RlVP3g 3rKKA9LUKW7Sg5OyIE1XA/jZzeX5JSCmoWQ9PuQmxQtlSCqD2X6W++XBMBz1IpfJed7/ rqlKnw0EmKoJYYap6h8EoYm7T8HnWa471k4GwPibInlT5DGJ37CVkx7mkmUL1SVjhsWe RJBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AddP0M3R; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 9si436604lfy.485.2021.05.12.09.41.55; Wed, 12 May 2021 09:42:33 -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=@linuxfoundation.org header.s=korg header.b=AddP0M3R; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241864AbhELQjw (ORCPT + 99 others); Wed, 12 May 2021 12:39:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:41538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236879AbhELPrF (ORCPT ); Wed, 12 May 2021 11:47:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB33961C9B; Wed, 12 May 2021 15:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833031; bh=PNu7+jadj9x9BmJTVziJwL/PZSEIZ6YdtI/TsPT2bJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AddP0M3RV53MPbdcgPhklB4m1LzbIfOnupv1+nQI1wUVKz2eCmlUS5/P+BC/AAP8o PAIkyaPmAtYoufXsT3kP7N5No7eUBD06dC+LAJ+LDil8oQhuBhj1VkQ4+mJrz4Chi/ 1bEjRybkGVz0lh86bC7uYIWMHkRLuYyPkv3/SXc8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lv Yunlong , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 487/530] ath10k: Fix a use after free in ath10k_htc_send_bundle Date: Wed, 12 May 2021 16:49:57 +0200 Message-Id: <20210512144835.763338058@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lv Yunlong [ Upstream commit 8392df5d7e0b6a7d21440da1fc259f9938f4dec3 ] In ath10k_htc_send_bundle, the bundle_skb could be freed by dev_kfree_skb_any(bundle_skb). But the bundle_skb is used later by bundle_skb->len. As skb_len = bundle_skb->len, my patch replaces bundle_skb->len to skb_len after the bundle_skb was freed. Fixes: c8334512f3dd1 ("ath10k: add htt TX bundle for sdio") Signed-off-by: Lv Yunlong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210329120154.8963-1-lyl2019@mail.ustc.edu.cn Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/htc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index 31df6dd04bf6..540dd59112a5 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -665,7 +665,7 @@ static int ath10k_htc_send_bundle(struct ath10k_htc_ep *ep, ath10k_dbg(ar, ATH10K_DBG_HTC, "bundle tx status %d eid %d req count %d count %d len %d\n", - ret, ep->eid, skb_queue_len(&ep->tx_req_head), cn, bundle_skb->len); + ret, ep->eid, skb_queue_len(&ep->tx_req_head), cn, skb_len); return ret; } -- 2.30.2