From patchwork Thu Aug 1 02:43:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingyen Hsieh X-Patchwork-Id: 13749497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEBB3C3DA7F for ; Thu, 1 Aug 2024 02:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ZlbCm7uef4/UrVlLEM/AL2L33IhcxVN5qA+lZPThapo=; b=Ytsb/00YtFDMsLKHKI5PU8m0A0 lyoF+xDq/R7vmRN/8DH++YiuwXw04Fj6ZRYwDNmBt9f5Fh4eGVXGMSgxyib0/l5IQsa5u3EB78bqM ZJ5US1C5kil/AmemVT7tt0EU1ccy0KNOaC3nCXKGfPE0m/twr29LDFYvOCgC4Xojl5k5U6wy2f83m 5/ZraAm2QeNE0Bl9nKBGo13WqSV+SHlqZZyPnxX7sX+/9KZ2eEre6IL8W+1kxr5TKa7fxOTSErPza TX3v7ncpddzXbhD6fB3VKTcjIBevKwXDxs1dKLFIIHKeZKKKv6IBCqJT7046lPjSuA66+2y6rjztI sJBWubwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZLnj-00000003UO6-451A; Thu, 01 Aug 2024 02:44:23 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZLnh-00000003UNR-14BK for linux-mediatek@lists.infradead.org; Thu, 01 Aug 2024 02:44:22 +0000 X-UUID: f146d3184faf11ef955bff358274dad2-20240731 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=ZlbCm7uef4/UrVlLEM/AL2L33IhcxVN5qA+lZPThapo=; b=FDyUwx8Ke0tE2jDHLl/ri/SQqX5YDRWegyK0j1aQybahdXAVSlsV1HV6VcqpMpbAdKs8uWAHfYr5R1jg0eo9H8faoWC2H31xw6zmrw/uRa27a6wICGKV3Qwgx9NwqgdhQ/OhpQuLfM8VPkUuzxpTeiMA7ie0rhA96ydt2VTlvjQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.41,REQID:0b370db1-5e36-4c5d-9057-0b1332580c1b,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6dc6a47,CLOUDID:74a3f645-a117-4f46-a956-71ffeac67bfa,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: f146d3184faf11ef955bff358274dad2-20240731 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 100633327; Wed, 31 Jul 2024 19:44:15 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by MTKMBS14N2.mediatek.inc (172.21.101.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 1 Aug 2024 10:43:37 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 1 Aug 2024 10:43:37 +0800 From: Mingyen Hsieh To: , CC: , , , , , , , , , , , , , , Michael Lo , Ming Yen Hsieh Subject: [PATCH] wifi: mt76: mt7921: fix using incorrect group cipher after disconnection. Date: Thu, 1 Aug 2024 10:43:35 +0800 Message-ID: <20240801024335.12981-1-mingyen.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--1.054900-8.000000 X-TMASE-MatchedRID: Pjd+1EAfy9OCa0Vj3N+Gfh3EEAbn+GRbsf4f4CxxueTKP6Yywb5aNpta BHqjRFBGd1ipXxYWqcLx1S0rgG1nwJCoy9iDotiw1yMJs9mBCcUF15s6prCIu+LsQIDmr3S5j43 o0FlG3q3i8zVgXoAltsIJ+4gwXrEtwrbXMGDYqV9/FUQjcNJIgx+5JIYu1yGn02DURdY8xg8mvg 12NZLwyw/wmuAAOEmUVh2w4hUGtnIfkChiPoQbEkaBbOhsUDoXpx3ZVH0eE9I1EPsh9ihYYHZrU bEZipAEiWT09mQz7szw9kH8zAy44SIduk5Jkjd3wL6SxPpr1/I= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.054900-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 3ABD420CA82E1364BBC214BA4E1A5C17B1E218DA297A1687CF250AFCA6B384C12000:8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240731_194421_325721_96766980 X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Michael Lo To avoid incorrect cipher after disconnection, we should do the key deletion process in this case. Fixes: e6db67fa871d ("wifi: mt76: ignore key disable commands") Signed-off-by: Michael Lo Signed-off-by: Ming Yen Hsieh Tested-by: David Ruth Reviewed-by: David Ruth --- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 2e6268cb06c0..4f4577b7e544 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -537,7 +537,13 @@ static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, } else { if (idx == *wcid_keyidx) *wcid_keyidx = -1; - goto out; + + /* For security issue we don't trigger the key deletion when + * reassociating. But we should trigger the deletion process + * to avoid using incorrect cipher after disconnection, + */ + if (vif->cfg.assoc) + goto out; } mt76_wcid_key_setup(&dev->mt76, wcid, key);