Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2648461imn; Tue, 2 Aug 2022 10:37:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uVwnajeKp8lUtcbnqlqneC8dhODQ3KjnTtua0qGSobtOaOn/oyTa+cIA7E8a1cTgbtfvO0 X-Received: by 2002:a17:906:7308:b0:72f:3294:8002 with SMTP id di8-20020a170906730800b0072f32948002mr16648483ejc.311.1659461824803; Tue, 02 Aug 2022 10:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659461824; cv=none; d=google.com; s=arc-20160816; b=KQyK+0kcKzJtGmB3VoiFx69+gKZXTNaGj7Ou1L7RvIOSyVz4rl6xThROHCoxxTBlCL Lz+hEA+zA5/NlxQXdLFDEdJRec7NBsOUA+htIUVVvUU8ZrRAZdU30TszeBQSHgRw03vA KKH+n21eRdKLMkcfnwVOoIYm39kt+SkdKPONCs2aHwrMMaPzVRSxHGdkURlGz1onNWFs DeVTfDIfHdT4vYmx0/fMxEeAuPdptimX6wGx62NtBP012LpNMjcIgS9/TABKw3qAriy5 Vp2W373vLH7iknyjGa6eIUuMYDOXdah58A6BAGOOQ9sMjMtqFGwZxC5+4ddEne0/ZcWr pxXA== 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=rFx9PAptbdyB41mYU0GhOYU9820TciHP31GrmlGpiTE=; b=0AcPDwqUFpr3M+xcmLnkr8YGrJ+dn3rfqOaKYN2QMJXv/bUgF3BfOzmo8WK5WJBpP4 hyJA/GlS35HtVxLO6wnpx/EAuse/vxPKgGjeSb7Qdo/DLzl/vNXGevLeogY09xArgUrY 2OedjxIvzJ9GWFK+kyRhnoSgumE9jr86Bbx9yF2HuQjejWKzNpinTeqrvoX0tivuMGu8 FMXJJxFcMkkv/Xmorcl0oX944qHeGFavX3nZBmn29q5Ar5eAeHLQmJlXJEPPaH7MM0Bi mt3kAVOaqXTXqGLQaAGQinziTVcgzXVezzSbpxls4JH4OjjVOhbaAexQTvJ6FPsh7RCz Jlrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@matician-com.20210112.gappssmtp.com header.s=20210112 header.b=qFtY1acQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a056402038700b0043dd94fec91si3124726edv.620.2022.08.02.10.36.43; Tue, 02 Aug 2022 10:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@matician-com.20210112.gappssmtp.com header.s=20210112 header.b=qFtY1acQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234672AbiHBR3K (ORCPT + 66 others); Tue, 2 Aug 2022 13:29:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbiHBR3G (ORCPT ); Tue, 2 Aug 2022 13:29:06 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D78DA4AD4F for ; Tue, 2 Aug 2022 10:29:05 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id 206so9415604pgb.0 for ; Tue, 02 Aug 2022 10:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=matician-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=rFx9PAptbdyB41mYU0GhOYU9820TciHP31GrmlGpiTE=; b=qFtY1acQ8OdbI3cKY7CHTkYdeB8qC4mmC6i7WpQq59D5cTAr8fKqHCJE910vK9YpkB BducnnIExS7FtRuKxNXCxngu58umwXslLONJxkXPEQXuoM5xktUutPtotw0rUfwdKfiC Y6WsIgJP1YXphNGXQZVFyISX/xExC9lnvLQwTxXkRHN0CquI0WdryJ6tW/qdCF3/eQlt Sp6cCGtE565TRm5x1/YVc7QaUl0E3taNdVow68bC+JW0QR09MBk8okmPjTqPIS4HzBXc vjh5ChRjRdID7/nX9ETHdteC/9r11CS4lb19zQ4ob/Syu4KUUVLxr7pGPLfv37wXYMs0 tTNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=rFx9PAptbdyB41mYU0GhOYU9820TciHP31GrmlGpiTE=; b=ndq1x6gO/TDhJbesIDH3uaZqCkyKiuo0u+7fxpLfHvooK+2ngCu1+G3PLjLJI1jVXK 7JRB7+l4dgUqA7iW8AhmZTQ8gYz0OgMll39FC+O0iW8kR4pK/VXZXkT4hK8IBZqR3Pq+ rBLdQ6MTHMCn2MZ+8bQpkVvLcNpsD5RrNgowt2iLf3FoGvguJTaKlkP91HXQIxY0M6T0 HEuMZmoEqWvEUqArtPybEliK6qhmLoo/Iip1NC/0kwSvRMfrTju8Wo7yRBHgoqVjI0Dz db0yz7yHLs7DmmkgFC6NDL+ddxILtY1xVfmzg+OqRRGWs6+/MmikEziNbwRBudXZfkHq aM1g== X-Gm-Message-State: ACgBeo0/EFUtjiCXz6bhfsVbSfZErocJrMpdwhUwwLGVq3hHqKdaAiva XORvSi08a51wJUlI3num20rxig== X-Received: by 2002:a63:8242:0:b0:41b:e465:81dd with SMTP id w63-20020a638242000000b0041be46581ddmr11825673pgd.217.1659461345148; Tue, 02 Aug 2022 10:29:05 -0700 (PDT) Received: from coffindebian.corp.matician.com (64-71-25-152.static.wiline.com. [64.71.25.152]) by smtp.gmail.com with ESMTPSA id x9-20020a170902ec8900b0016c3affe60esm12339056plg.46.2022.08.02.10.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Aug 2022 10:29:04 -0700 (PDT) From: Alexander Coffin To: Arend van Spriel , Franky Lin , Hante Meuleman Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, Alexander Coffin Subject: [PATCH] brcmfmac: fix use-after-free bug Date: Tue, 2 Aug 2022 10:28:23 -0700 Message-Id: <20220802172823.1696680-2-alex.coffin@matician.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220802172823.1696680-1-alex.coffin@matician.com> References: <20220802172823.1696680-1-alex.coffin@matician.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Alexander Coffin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 87aef211b35f..12ee8b7163fd 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -296,6 +296,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, struct brcmf_pub *drvr = ifp->drvr; struct ethhdr *eh; int head_delta; + unsigned int tx_bytes = skb->len; brcmf_dbg(DATA, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); @@ -370,7 +371,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, ndev->stats.tx_dropped++; } else { ndev->stats.tx_packets++; - ndev->stats.tx_bytes += skb->len; + ndev->stats.tx_bytes += tx_bytes; } /* Return ok: we always eat the packet */ -- 2.30.2