Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp508446imw; Wed, 13 Jul 2022 02:48:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1upKmROrGqMwcZ9tpOCnjqr3kKXsuM44yEqKRb2l7kV35usUg/ln9sER2WJKZ2lL+DzzOvH X-Received: by 2002:a17:903:26d2:b0:16c:1684:4124 with SMTP id jg18-20020a17090326d200b0016c16844124mr2425248plb.9.1657705712284; Wed, 13 Jul 2022 02:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657705712; cv=none; d=google.com; s=arc-20160816; b=VnhDMJ0EPVjoJsNJPkmtqmayTltt0N7X2qnwl2mPK8V8AwIh0Wf6Wl70ouQYhFg4Sp hgiVMVeXzGvJ02EQTgSf8F3JuBHZ/9DkgTdcQvQYKFkd9HsAfR0/6wH6I6TtCjObpWlP UPXh9wdx0Fw9iH414cI1vLCQyDZXolZh5DtT3DP081b7wlwHWeohKT/WiyduxObmFtAM DV5vfCNWFlT8tzF4m1GNOAKDrocz8mvaPC3BP50UZzndkerfonnxduJUeVS9peEdYTOz n44N4ZI0sXvzklXfH7jvPTmrGr5RFf+AR9n+ghuxqCEds+B9GCUT2MggPMmwb6TweN6m 02Jw== 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=xFn6oC0kdfPkHMKBQ2DcZJZ21nLL87M4kJuAwXNHwqs=; b=W1zBm1o4SB92zbSqJVx6N2N1w2GL0XS18qFLAy8EoqRHXNbskkRWjN6gtmeCT+VWwr uLo52DwHz+Aq+1MpQSX2ipUp+XwbD47R2V4L2M01RSwefUTB9M5lNx8XVdr8r1tfZma0 snmAXkHGHT4Ua1zmb0ZCZuj+oH3wcUifqsKU/FYrGkpNBBWgZ9Bdzp0AN+IGFkcj2sdv OKJE5wHeH+gOVUlR+iFh/RlfDrTSwtu0zqfGjQl7ntOdcpnrfQzwW0edj3Pq/jFzP3ZP prW+Rz745x5TmQct/GcRzhQ6y8LNCyKRWsoCrnrEoX/wWD3aCjI2HF9j4mfXs2kapRHx cPlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=m5aMrXZY; 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=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h190-20020a6383c7000000b0040d1da68c7bsi16641889pge.7.2022.07.13.02.48.24; Wed, 13 Jul 2022 02:48:32 -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=pass header.i=@sipsolutions.net header.s=mail header.b=m5aMrXZY; 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=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234585AbiGMJpj (ORCPT + 65 others); Wed, 13 Jul 2022 05:45:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235766AbiGMJpN (ORCPT ); Wed, 13 Jul 2022 05:45:13 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E9CEF9C9 for ; Wed, 13 Jul 2022 02:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To: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; bh=xFn6oC0kdfPkHMKBQ2DcZJZ21nLL87M4kJuAwXNHwqs=; t=1657705513; x=1658915113; b=m5aMrXZYcYTtVaf+m3dIzP/jqogjKWHxp571D1e+woyetq0 M71GvTMz06619AumTMPqHUPvBnDFXlrFi89RjsOaMdMzWc5ykieMnHVlaF8CpcdreMkq6tQMagmQT LDXDtQyCPxd+KnuVkNNEXqPjIn9k4p58pg49FJy6ZV4TPmWZbUJLcDs0v3bdYORGvXAlVUdQec4sZ HLeQgqVdKcRnzMs1kmVaK6xkhsVEMbxlHYQ12SSzdh5IihdnAdFokGWcrTv4ZApAAUquNVJ0iHsVj R59KCv09PilVI7NF4edPOs4kQ08K+G4PVvoKNVK3D8GY1LS0+0LdzqnfHC3O1cTg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1oBYvf-00EgvB-35; Wed, 13 Jul 2022 11:45:11 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 22/76] wifi: mac80211: fix key lookup Date: Wed, 13 Jul 2022 11:44:08 +0200 Message-Id: <20220713114425.ed2e3ae60fc6.I769221e274dd44729bfccc0f58cde71d9f25612a@changeid> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220713094502.163926-1-johannes@sipsolutions.net> References: <20220713094502.163926-1-johannes@sipsolutions.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-wireless@vger.kernel.org From: Johannes Berg With the split into keys[]/deflink.gtk[] arrays, WEP keys are still installed into the keys[] array, but we didn't look them up there. This meant they weren't deleted correctly. Fix this by looking up the key there even if it's not pairwise so we can be sure we don't have it. Fixes: bfd8403adddd ("wifi: mac80211: reorg some iface data structs for MLD") Signed-off-by: Johannes Berg --- net/mac80211/cfg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 058163b97c9a..a4e511766008 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -570,6 +570,10 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, if (key) return key; + /* or maybe it was a WEP key */ + if (key_idx < NUM_DEFAULT_KEYS) + return rcu_dereference_check_key_mtx(local, sdata->keys[key_idx]); + return NULL; } -- 2.36.1