Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5485100ybl; Sun, 22 Dec 2019 07:07:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwrmw17Joe664bUQNPKoF2tf9OLeSVGoZSwRKs6UWrfgcPGN9Zn4hp1UMwrSExwuy8FGCc4 X-Received: by 2002:a9d:6c92:: with SMTP id c18mr10631707otr.157.1577027257332; Sun, 22 Dec 2019 07:07:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577027257; cv=none; d=google.com; s=arc-20160816; b=rxjHaSwrQ3l7pv19narUOvVLDuusz5iglbvKnuKN1D+G19EQZSoXf+Sx1KTN4RlMdI b6DaxXX9/wBe0K90i4u56h9GMXjH/omVqByw7j/VaO+z1WFfnGMRdPdezuQeNS3ijiLh KX2ekBOT8uR9uW8Af08af/4vimqZJkc/myJ44R0dUws4MkNkmLd2FO5jhfDaIFH/W4SD r95uIzBZgAwtJkejcbYMfznIhded8sdas1Os+lCgIurpeSrtdWTIqXWidHuHml5Ssspm 1/mWp/h8PaNEPpAAirDAF+NDBJlwZSAlP2Teq5D8SZEI12KTlEhYGQ26ANH5kQTGvukA PxhQ== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=sy6QXNlWforqwdkGoQGiL7LT7Z9fULlE3Ro0jFvGKZA=; b=Qa9QuKnwJ6yfcHgasTSa6nAqiOnvEeFnw/Phes9Sy+we+dcBZj4uE4UmN4d0GrKMCs NHsXG+o8cKAKCVqGB0Mskt61O8zAUnmOywXy0JIYXswUotTR0vzeXRZG8HY4tMmMhxka UC0QlmAlZX+6zlO7hF96oaTtqiZbpwoDY5RBvhSv9HE4niu4Z6nDcFfrQewTPJdjLX+p qBi2JEVCLpnlRKq4tNoo4DW8viJHM3Ng0g9O9l8iHab2jS5MtHbYBJ/MiHknmo97r5/d cbINbPvxPIrVleB+54QXw7a+oL5xlReqzMqBfHH6hVbmiBD2x04odOWhzMROGYGw4ll8 xArA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=NtD8ntrw; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 m20si2437366otk.279.2019.12.22.07.07.22; Sun, 22 Dec 2019 07:07:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=NtD8ntrw; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725997AbfLVPHT (ORCPT + 99 others); Sun, 22 Dec 2019 10:07:19 -0500 Received: from nbd.name ([46.4.11.11]:47410 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfLVPHT (ORCPT ); Sun, 22 Dec 2019 10:07:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sy6QXNlWforqwdkGoQGiL7LT7Z9fULlE3Ro0jFvGKZA=; b=NtD8ntrwNYzkfYjc+Xg3JmLIMO vCwXdFZ/mdGfTsqPsqBLWq8XFmQ6GmMpKKhu0ooSEPJdbu9Omn7H13/cDGQos4ayxmqyBTRLIFS3n h2gfME+8dxVQEz4c2kMUdsaUYwyHaCileUJiC8+3Kkd6AIT4Xkc1oYRC8rhSb9Qm6DcI=; Received: from [81.95.5.44] (helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ij2pB-00030X-SB for linux-wireless@vger.kernel.org; Sun, 22 Dec 2019 16:07:18 +0100 Received: by maeck.local (Postfix, from userid 501) id 50A4E742EAFC; Sun, 22 Dec 2019 16:07:17 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 4/4] mt76: clear skb pointers from rx aggregation reorder buffer during cleanup Date: Sun, 22 Dec 2019 16:07:17 +0100 Message-Id: <20191222150717.51379-4-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191222150717.51379-1-nbd@nbd.name> References: <20191222150717.51379-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org During the cleanup of the aggregation session, a rx handler (or release timer) on another CPU might still hold a pointer to the reorder buffer and could attempt to release some packets. Clearing pointers during cleanup avoids a theoretical use-after-free bug here. Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/agg-rx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c index 6d64c2c4a159..3815d28a32ea 100644 --- a/drivers/net/wireless/mediatek/mt76/agg-rx.c +++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c @@ -276,6 +276,7 @@ static void mt76_rx_aggr_shutdown(struct mt76_dev *dev, struct mt76_rx_tid *tid) if (!skb) continue; + tid->reorder_buf[i] = NULL; tid->nframes--; dev_kfree_skb(skb); } -- 2.24.0