Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1016993rwl; Fri, 24 Mar 2023 05:18:44 -0700 (PDT) X-Google-Smtp-Source: AKy350YEmveuR1Anzk4TQiAnVEQCqrHxPiDz6xsa/SdJuERmA7XHrsOR3Wgr0SMRtWLwW3++CKJm X-Received: by 2002:a17:902:e74e:b0:19d:1674:c04d with SMTP id p14-20020a170902e74e00b0019d1674c04dmr2627241plf.61.1679660324645; Fri, 24 Mar 2023 05:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679660324; cv=none; d=google.com; s=arc-20160816; b=xyuKzaWYEdnOK6t6fRyJVmFiwwEJt/XnfHiswo+ilVHKRzlnTBOrm81d78B2Lw9mFk sW3VCyRTNb8lQW29+KjjSwde4HVZ7XcwEF2k2AW+Ujr1LqssnI9biaXCC39qUjVgCnDB nzqeQ3ZCgzrmzMpqxWZEFLsEeEXROy6ReXT8NOj2NSHvmoDNPCWazKP9iQuk1pDzFyeN gLiFlNRDsVqYkFHF+VK8dtnf3V41Y6V1bMHWoxbUwBE5LY6VU7iQDDV9gFMbUil+pvED 4ehttN0UCLCbIwRW0uET0X93LwOvsflUJpggeUf/sP8D4QX6WYEdgdKZqRC6cbI16Em0 NhKw== 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=Ba7APSsP9lFawXVqf0ZyOfsCS1kh5wfG/ymWwZVouqI=; b=psthNMYIKrFDeIWjLzL94jZcyrR8+FsC017wsISLf4LMWRtMU+dWrKvzm1X3OVuKu8 iwMw5x73IDGPLYeLoEjK3J+hYdAaw2MwsFAV8mxBt0o+TAJQussPTIGLwjqnb8KLNY9H Pmgwo1OIfuF/3w9TRozpOhnzp6Npu9DI/0GjVcpWxpM6h54vS451wz2XQseTOX17RVn0 +vWtSNZ3KYMhFHjCvFzuzYaLGypIuTqU9+QDek8ANTb2KdhZKPglJMF0YzX3keXURFGe Jqd1JpByRqa6m7sHEpBmgnyX3IqE9TF3UHJL8MxUswVj2yg64yzGGAt5qjw1ALwm+Yyy xvxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=VNIBraU5; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a170902ce8900b001a185d3cc26si21246126plg.219.2023.03.24.05.18.34; Fri, 24 Mar 2023 05:18:44 -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=fail header.i=@nbd.name header.s=20160729 header.b=VNIBraU5; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231611AbjCXMJb (ORCPT + 59 others); Fri, 24 Mar 2023 08:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbjCXMJ2 (ORCPT ); Fri, 24 Mar 2023 08:09:28 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6756199 for ; Fri, 24 Mar 2023 05:09:27 -0700 (PDT) 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:Cc:To:From:Sender:Reply-To: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=Ba7APSsP9lFawXVqf0ZyOfsCS1kh5wfG/ymWwZVouqI=; b=VNIBraU5LVYVGO5czehHq30Hgg JrXWfRDW/Y2t6hCHZyolK3Xn8uI1RkOmPUgWDJfNPyG75EGEzDsvPqQK0CkW64i7r7qK4+9YwOeOP VnBplbG9mifugSPmA4+bIn/lSuJ708uSNO4y+1pkSQAISVOYkGcrRAnjF9cquO/RItso=; Received: from p54ae9730.dip0.t-ipconnect.de ([84.174.151.48] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1pfgEX-006Liq-Hr; Fri, 24 Mar 2023 13:09:25 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Brian Coverstone Subject: [PATCH 3/3] wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for non-uploaded sta Date: Fri, 24 Mar 2023 13:09:24 +0100 Message-Id: <20230324120924.38412-3-nbd@nbd.name> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230324120924.38412-1-nbd@nbd.name> References: <20230324120924.38412-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Avoid potential data corruption issues caused by uninitialized driver private data structures. Reported-by: Brian Coverstone Fixes: 6a9d1b91f34d ("mac80211: add pre-RCU-sync sta removal driver operation") Signed-off-by: Felix Fietkau --- net/mac80211/sta_info.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 7d68dbc872d7..941bda9141fa 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -1264,7 +1264,8 @@ static int __must_check __sta_info_destroy_part1(struct sta_info *sta) list_del_rcu(&sta->list); sta->removed = true; - drv_sta_pre_rcu_remove(local, sta->sdata, sta); + if (sta->uploaded) + drv_sta_pre_rcu_remove(local, sta->sdata, sta); if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && rcu_access_pointer(sdata->u.vlan.sta) == sta) -- 2.39.0