From patchwork Wed Oct 19 08:25:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp350257wrs; Wed, 19 Oct 2022 07:13:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5HL9rrWIMfbqpWnEk4eoiSEq353D6NrCrl5ummpbrJDimPr82OBfhaAuxRh+eafFfz3Acu X-Received: by 2002:a63:2a02:0:b0:42b:2711:d534 with SMTP id q2-20020a632a02000000b0042b2711d534mr7325469pgq.176.1666188800697; Wed, 19 Oct 2022 07:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188800; cv=none; d=google.com; s=arc-20160816; b=FjPuIcIz02tVZTnoOjZda2Utx12VBhgkHH0aDF/7ZwotUG0QsF3fmSHpFZy+nqAFjZ 6sQIV1Kf9YvvBfVu0xkz/xNQTuQMCKhUs21nRTVg7NRqtgc8sqsi4u/Rikt7h52G16pG mhmTBmzwFujph4NvgCAFqohUfyOsqwcjFPWHqkEq0SKCWeNa6NWKcp6dUkPOgu6zSokK 7oTNRdyFPuu30S1DuQYF/RWh+g6Pc8e09HFvqVlDV40KwkAVTo/XouAKfrETMNi6rEsm ULLFzPJFEUNbLMlig23nZvHzM3QFhz/EBdh4pb4e88UyLBgLN0P6sRJj6i+aX3c+g8u+ X46g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gJ64OTZQe5zBDubnGL4U1/HAoT/pWCDP/EG4qB2TUaQ=; b=WVKqfeQkDg1qnOYNO9Q9Kvr/uC/3AY5IcJxydERaxa72NjaB67ztXoDx1XsuLYgSZn 8ORFOBcZHolj4Uu6AzswsqBZJE4NqFMahByKAZBVkw/pgZIU/jbbfQoj2egtJck641AE y3ZzNlv59D6a7Byhiw1qUI8WZDytSVVRQSaS2mokNM1CquWai9KYg9k9JNVHdvuuFBl6 RiBinzi62j1n1PRdmIh88R9h2s4UJpwounHjabz5SrVdYefQE1H8hiMhbUZ6RraxPadw pB8IoMiQiJ9fIQsyZwLdSBF7ixUXkbcRbNrO4O1g55YZh3XZbLw78fOVESnmeb8wmxYq 7ryQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yf2zINUJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y124-20020a636482000000b0042bb607f75esi17808018pgb.284.2022.10.19.07.12.47; Wed, 19 Oct 2022 07:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=yf2zINUJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233702AbiJSN6n (ORCPT + 99 others); Wed, 19 Oct 2022 09:58:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234069AbiJSNym (ORCPT ); Wed, 19 Oct 2022 09:54:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 881A3132DC1; Wed, 19 Oct 2022 06:37:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D933B82387; Wed, 19 Oct 2022 08:50:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F438C433C1; Wed, 19 Oct 2022 08:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169427; bh=bWaCn8E8sqheU4Kuv/pIWO/8UF7dv16NNlulGm9SNbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yf2zINUJzTDhEDVIK+ONIX/hP2n9fzWZk1ImM0FLMT3X5SUuYNl+GqypFuczS8TvL R7qgFIxp78aHNHCXhmhUO8TLKUWQ1hSUc4xghzrv6llZYk8OEU40/mnc2AGoVS/g2G ina6uMIvNNdTNs7YSBFHn1WAFOXdT7zTA3thIIXk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shaul Triebitz , Johannes Berg , Sasha Levin Subject: [PATCH 6.0 238/862] wifi: mac80211: properly set old_links when removing a link Date: Wed, 19 Oct 2022 10:25:25 +0200 Message-Id: <20221019083300.554557388@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747125588142903875?= X-GMAIL-MSGID: =?utf-8?q?1747125588142903875?= From: Shaul Triebitz [ Upstream commit a8f62399daa6917e7f9efeb79bce4dd2cd494a1e ] In ieee80211_sta_remove_link, valid_links is set to the new_links before calling drv_change_sta_links, but is used for the old_links. Fixes: cb71f1d136a6 ("wifi: mac80211: add sta link addition/removal") Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/sta_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 58998d821778..9d7b238a6737 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2799,6 +2799,7 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id) void ieee80211_sta_remove_link(struct sta_info *sta, unsigned int link_id) { struct ieee80211_sub_if_data *sdata = sta->sdata; + u16 old_links = sta->sta.valid_links; lockdep_assert_held(&sdata->local->sta_mtx); @@ -2806,8 +2807,7 @@ void ieee80211_sta_remove_link(struct sta_info *sta, unsigned int link_id) if (test_sta_flag(sta, WLAN_STA_INSERTED)) drv_change_sta_links(sdata->local, sdata, &sta->sta, - sta->sta.valid_links, - sta->sta.valid_links & ~BIT(link_id)); + old_links, sta->sta.valid_links); sta_remove_link(sta, link_id, true); }