Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp433891rdb; Mon, 29 Jan 2024 06:54:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuUbMzBYw1s6hdyqoo6HeiTad0izl6AFt8++Ot3wW7dGa7Jg0Tys11NqubgP3c5+0AxH3Q X-Received: by 2002:a05:690c:3603:b0:602:ce8b:6aec with SMTP id ft3-20020a05690c360300b00602ce8b6aecmr5689374ywb.51.1706540041487; Mon, 29 Jan 2024 06:54:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706540041; cv=pass; d=google.com; s=arc-20160816; b=W8bg9BUYNYXmcpn2BhJ2gzgwjM8xcZzZCYmFEtqllm+GlTvAc7HdN4VUM+NlNDZQEg F22kyNseWXDdZJwLlAt7WKN501Ix6GLohkK6WKozq8k+8zgcOs592oQXQJqSI0DMBimq y11gQlpHf+3hErVO+1ZTygjKpjzZ3lfxRLsHR0htq4mdjyUc4q0Bsm1MkAm3uYuJ+1Ev iBhmG5Un1Nmd7KIStbU6NiQhG/3BGYfw1zMcQlf6G6djTggFtoXIn+RCy/tYipM4CPCm aAlz5g5OaDsT6EaP8uw9knq1xAjXbx5asNYezRed6Ond5Gmh2vrVW7OWskUaRtBaXgV4 3K9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=1xc7kEElmq2lH6BilhyWFZy2Gf07+UlqKuqFPd/00Ss=; fh=LvM8YzmIKsto/PWHZdVSkbH+wYEBvyRXaZYyyVWMqiE=; b=b8yXiwQteY2tJyZMYWkr+z16rlG23IEEGRtpCh6Wnb820zsS8ujBXYKzESX3Ngk3fV q4Lyfck5FA8M/jK9AJcbajc5ZImHqPO9kaco2+bSHw2YGL05j0fzsGucAy76wOLl8/Q5 py2WkKzcAfNv5ilQ6lsB6vQo9k+YwCkXSTAVyTnnr8xNH4V5dSZ3QlRxgYt2guVxSqfW 3maJMua8+uyhReAqwJLmM3LSdH5uQjvX394+QTbGkjA0/M+gCqi9e+U4L0dvmkXaQ7Ci 7T7eoaDA1c2CHdTnYcWjJ8ZQAec6s3XTex02DFZ4mqJnv58hBquoWvraxGHgM5QmYZbF lzwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=qq2F45qQ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCUZJK3McGbxjo2zORy6yGdUx9ZcR5V3PD0RptLt8dBWGr5a2FPNVedA06RpFRrs4TKfK75yJB2HPuEnW9qb9GII2GU149hx0rnGaqySOg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jo30-20020a056214501e00b0068c543fc876si1091808qvb.247.2024.01.29.06.54.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 06:54:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=qq2F45qQ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2C4961C21462 for ; Mon, 29 Jan 2024 14:54:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A14EF152E11; Mon, 29 Jan 2024 14:53:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="qq2F45qQ" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 538945B5C1 for ; Mon, 29 Jan 2024 14:53:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706540037; cv=none; b=ala4usXmPPZEmS0pZJhgxOPeCFgOatznavQsjUYkJqpwiwamF5N/sASbe1ZSkOSL3TX3u6U7kNeFxJtdT+1h/WKEJ4x+syLejuvRuannonc+e3gDGaCHTxPxm0aD6FznhV59E0r0W2wI4pdEUqP5PV/QttSXB7dyYiTysJJ13Sg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706540037; c=relaxed/simple; bh=k22XOvcDReIa0xvF18gIGGIHGY7/s9wqDxWvobbUZeM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TZ3V0G1EP6S3ySIA0LfYAzN1zVVTYmDcAKKKd299USaRYuxFNNmt/8OQPyKmk7xnwhL9aAy71qMLbV4LVigHZz6Y90JhzE+cyeOYM5QjrdvRj2qH4v/K0PP5rYB4Vju45Hk6++8k+f2NGELALsOLm6Usjp1RQLj7BWPafQsQSF8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=qq2F45qQ; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=1xc7kEElmq2lH6BilhyWFZy2Gf07+UlqKuqFPd/00Ss=; t=1706540034; x=1707749634; b=qq2F45qQ3cukoHvjZit26RqaYex9Y3UBJIWIItYC4t7SaH20QdVdZ68CXnihQpMGsZTiT0fxwwn Ls1Z3tW3s0p1X5lGEyCEdgSKMLuyUdGFbCP4RUnKO22U37HRUS0Zb/w/seT7Blfvw8KyerdTOVqmt NxbVkaC45DVOgNtgr5ViHw1DHR+VQu75VGhy7r+7MsdAo4CeX3ZAvEqRNfCDs9ZMBx15/POdwk+aV yy8qWP1Fo2EzwtlJVqAx35GjbKCn88gdeg7183kHesA/23bT5KLC+C7HcqL/nx3RKE38o5jkfLTVZ F3E67OB872o0kq4LViQ6sWKbLYTMDlspbfHg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUT1C-00000004tLt-3Ar4; Mon, 29 Jan 2024 15:53:50 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] wifi: mac80211: fix RCU use in TDLS fast-xmit Date: Mon, 29 Jan 2024 15:53:48 +0100 Message-ID: <20240129155348.8a9c0b1e1d89.I553f96ce953bb41b0b877d592056164dec20d01c@changeid> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg This looks up the link under RCU protection, but isn't guaranteed to actually have protection. Fix that. Fixes: 8cc07265b691 ("wifi: mac80211: handle TDLS data frames with MLO") Signed-off-by: Johannes Berg --- net/mac80211/tx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 68a48abc7287..e448ab338448 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3100,10 +3100,11 @@ void ieee80211_check_fast_xmit(struct sta_info *sta) /* DA SA BSSID */ build.da_offs = offsetof(struct ieee80211_hdr, addr1); build.sa_offs = offsetof(struct ieee80211_hdr, addr2); + rcu_read_lock(); link = rcu_dereference(sdata->link[tdls_link_id]); - if (WARN_ON_ONCE(!link)) - break; - memcpy(hdr->addr3, link->u.mgd.bssid, ETH_ALEN); + if (!WARN_ON_ONCE(!link)) + memcpy(hdr->addr3, link->u.mgd.bssid, ETH_ALEN); + rcu_read_unlock(); build.hdr_len = 24; break; } -- 2.43.0