Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3701699ybv; Mon, 10 Feb 2020 05:00:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwd+FM//q+3tTQ5jgT3lcE10nF1SomF2/9rlURwiaKgQrAq9NNz/9iQTplOHRryMlAJ5DVd X-Received: by 2002:aca:a816:: with SMTP id r22mr745740oie.1.1581339609338; Mon, 10 Feb 2020 05:00:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339609; cv=none; d=google.com; s=arc-20160816; b=xGgYt+GDmS0CLaJMaa9BPP3ZkHwoH4G4m8yZzc0cB6bJceK79Wz0YSHowglTAFKNpo ecAUZVvTjnZPbXAuLMrAGNv9tXoKMamujhItek6CLiD0kAuDVp7RzWZzRdtIzB48GuG4 1Gl/mKx3iOP0FRQ8QAnrA6vhUF3v+hNoSP+ySLcV9MuvXRfFgrPrXq69Gdry5JoVk8xu 16caWXRvi2iGeZMHqvnb19E1H8KFPzGj+YttEyiApixed9z6kMdIJ54oKXjR9GA0bQDd W66a8u/PHXC8PgaoIWVaJteviHPgtX36BUKMguA4qIVEMWYmNFElUarMwJ7bcLC0IWz3 fZuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3eB46AxHT0Bx4LtxCmHAjMPcG7f5DBGZIx+RqQjVxzM=; b=D3ZR2N1TQd1g0ccLPVhqw3y36AOnlINwKZJ7QAsfze+mmtvagETxO8WOYTzQ0Ohist 9QD+gsi1rFUsQ1MAHOKhGJApqIzMGTB2FAZq+TM69Ki1I6eOFjrMQDLBXckCrZRmPC1G pkbqe2BbnIxmE6P+0bavpwfVMXO/TNUPWvh0+soPqkKUblgFhTLlGhh8NMCB7mrpZjY3 TTMviJrnLRiRQiMJ4508w2ukD9fAmExK+liT/LXnbmhr6EOWEgZAWl5zgrxF6QjX5HO/ TDPEq1gQ2m2HaHkj8UjQwUsGtszvWUAnQj1Uglwga3SetyrKy3CdJBtQSmj7X0L8KX6K qNfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xGgxqJeL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20si167239otp.4.2020.02.10.04.59.57; Mon, 10 Feb 2020 05:00:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xGgxqJeL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729804AbgBJM67 (ORCPT + 99 others); Mon, 10 Feb 2020 07:58:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:43090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729936AbgBJMlP (ORCPT ); Mon, 10 Feb 2020 07:41:15 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6A6762051A; Mon, 10 Feb 2020 12:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338474; bh=/J699oMm2O3gF9D+bDAXECvT1yvmuNGteL2a5lfpte4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xGgxqJeLyhqA5rCnI1OK9aImNhpFv68iY7tH4r+JkhvPYGwDcBfZ/9wCyCkedKW30 +K4uYWxgm4i79stJce4YFeJKtOkHklVfOnUigUE4ayHNcrCZcYJUxxmn2f0fltQqw3 MOTNfZIChDZYsENRX9Cc+j5LY1pjApzCz1K/Pix0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luca Coelho , Kalle Valo Subject: [PATCH 5.5 206/367] iwlwifi: dont throw error when trying to remove IGTK Date: Mon, 10 Feb 2020 04:31:59 -0800 Message-Id: <20200210122443.458465140@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luca Coelho commit 197288d5ba8a5289f22d3aeb4fca3824bfd9b4af upstream. The IGTK keys are only removed by mac80211 after it has already removed the AP station. This causes the driver to throw an error because mac80211 is trying to remove the IGTK when the station doesn't exist anymore. The firmware is aware that the station has been removed and can deal with it the next time we try to add an IGTK for a station, so we shouldn't try to remove the key if the station ID is IWL_MVM_INVALID_STA. Do this by removing the check for mvm_sta before calling iwl_mvm_send_sta_igtk() and check return from that function gracefully if the station ID is invalid. Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -3320,6 +3320,10 @@ static int iwl_mvm_send_sta_igtk(struct igtk_cmd.sta_id = cpu_to_le32(sta_id); if (remove_key) { + /* This is a valid situation for IGTK */ + if (sta_id == IWL_MVM_INVALID_STA) + return 0; + igtk_cmd.ctrl_flags |= cpu_to_le32(STA_KEY_NOT_VALID); } else { struct ieee80211_key_seq seq; @@ -3574,9 +3578,9 @@ int iwl_mvm_remove_sta_key(struct iwl_mv IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n", keyconf->keyidx, sta_id); - if (mvm_sta && (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC || - keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || - keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)) + if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC || + keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || + keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true); if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) {