Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp879574pxk; Thu, 17 Sep 2020 20:09:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziowCIbypOf/BK0BqkJ0F5Kjzapg/ceb3NzEH1wbz5iBGLdJoMvu3fnSAbYq4KOKQrVuco X-Received: by 2002:a17:906:a444:: with SMTP id cb4mr33033825ejb.432.1600398584741; Thu, 17 Sep 2020 20:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398584; cv=none; d=google.com; s=arc-20160816; b=CMRVtKGOfrRh/fCaGoPUidJprK6+mIPbPy2FxmgzekowfeiKnes8ajKWkWvRnTKOD9 B/7V9TjJp+kon+sRbkPVxQHMOG7a4k6xjzhu48pnkqOCABzeCY/53bniStcsoqac8Nh8 H+4gisIJssbbJIth9fqZb5ye0yJ5geo5M+cWlYt27PHg+WC+v9RK/23fZyHs3CjCDEhd m53mQMXNfng/tJEq+68JUylopOQ/+ELDvKyYbB9F2YvrOmSu7wA0pm76bfReVMADeBYp t9QNJ2bffyr9k3zKgFLLC+DVM2JNM93t10EJuf1NFyxRaUtpSq5IFLf9M9puZcuGtX0S 9hBg== 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=wfwjB1YED3IEH81S2NS/Q3vhrsD+oHbuLRPJWF+U+t0=; b=o0fjJJmH1Dj8UrAfVFGof0f+EU6sHEthpAvwfV44stRqvRMBuTtfUBp0DDoS4oE7Dv ldvmC97fcQ/hsYRTbNdfxLdPPJ5+YTB+Cs2DJQ7p5KVThrS1ygnGQNns7wjFgWB44XLv 6La3dpsZby9WyU/pQTTNDTpN4ysJFHEBVwSIBGH8/9tF9bmW2G/UZDVAnG/eCbGpkxEi aNoJTXuJyDJ/bqMET6kMeaZwbPmdeA9K1Rwmf83N1KSTD6E/bZQRNbXsRU7xncy37xdj L73ULZKG19yBMmnMaZjAncOzjEkR8Ny4zmwCpc4J+DAI/8O6Tl6XYJPMJOK14dBjn9S6 cs8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fqU3cGrv; 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 dn20si1465082ejc.196.2020.09.17.20.09.21; Thu, 17 Sep 2020 20:09:44 -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=fqU3cGrv; 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 S1730664AbgIRDHO (ORCPT + 99 others); Thu, 17 Sep 2020 23:07:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:50522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbgIRCDt (ORCPT ); Thu, 17 Sep 2020 22:03:49 -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 3D36821734; Fri, 18 Sep 2020 02:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394629; bh=EkxvQKN2BiZLqAT9vobDmZp+Guijf7tsfKu/d3ty/Qs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fqU3cGrvi56Nv8L89bDbakcTTZOwYQT7M7/JRm/GsuvXOPZEpHoOWH222EfUX1p+Y O/rMNjkbfL3KTgDLsGIToOcUjQQm7FOozJHXsEYUXoU45dk2P364w+TKrSjwUVa++3 2dLz2Tj4obhKopE8QmbbxcSpmx76Lf5NdSAjvw9w= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Felix Fietkau , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.4 129/330] mt76: clear skb pointers from rx aggregation reorder buffer during cleanup Date: Thu, 17 Sep 2020 21:57:49 -0400 Message-Id: <20200918020110.2063155-129-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: Felix Fietkau [ Upstream commit 9379df2fd9234e3b67a23101c2370c99f6af6d77 ] 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 Signed-off-by: Sasha Levin --- 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 cbff0dfc96311..f8441fd65400c 100644 --- a/drivers/net/wireless/mediatek/mt76/agg-rx.c +++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c @@ -268,6 +268,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.25.1