Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2962281pxu; Mon, 14 Dec 2020 16:08:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJykD24/OV5jMwj92XPC+kQiPODB8uNSdbUMlU2tiD5pF9tfI7Yl7nEFoqCfrSa3f0fgu0ML X-Received: by 2002:a17:906:94c5:: with SMTP id d5mr10976754ejy.427.1607990904347; Mon, 14 Dec 2020 16:08:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607990904; cv=none; d=google.com; s=arc-20160816; b=kdXJML4GFEKkDdHKxRZ+3m9LSmPWohvIiXQUXhhDK7Y9mTMAetmZMIwHPOCzRfETFF BP44L5DpB2ra2OErPZOaiDcigT7Pyt/NRUBXvQ2yj9feLGeU5Mt6quQ8hexatSey0XwZ MNpXpTNhuIWvSIm8jEb/lKzAyh/cqpiHCkDcY+RmOk91s05A0UbgwQfPSeeWGQ0M/7vT vEt1PaTzsCs/WKGxrEPtXfcb+DWafxEE3Ja8JXCJw7f6y7mXp45yMSYsxl7zK0QBWdzc aKWBPzUfQplbjF/1tf7G/iMi2JHqtJMmink3Ss6VGr7+VzjdoTi/f8/yebDB0uiv6eBH R+Kw== 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; bh=ekz4tMXubbiLP7VnadOpAKWiKTUavY4iZ3CHwMso0BQ=; b=tLOjW1PNNXErktn8IN9xEWd5IypKIUOnK4O5gxtuPyb2Rq9OhaRti/f0sSFxFm9kj1 mUdFll6l1Tib1MDHbjFCxCb/X7xcyAhqbEt1s2Oc2ZVvSPXXOnQz8GxQ8IosI9HmJ/LS iAy61SibMthUVc9emz3A1u2dEjvakhGsms52JGo0C/s0968NLBsVYmSwIbAb77GG9ynM DCIhQ8lYpmza9sc8G17Xn6LmGGInShFLv3alDWbkN0nvDmUhSjwtidAWtYZUXrD0kdpl BDwf3Z3hdhPvJSdKwZjIixGBOjHzQyogpUJe+b2Htcf1oke/yNy7kMZrvaYstqY7037d WVyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si33571ejw.561.2020.12.14.16.08.02; Mon, 14 Dec 2020 16:08:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502062AbgLNSvx (ORCPT + 99 others); Mon, 14 Dec 2020 13:51:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:46106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502249AbgLNRhh (ORCPT ); Mon, 14 Dec 2020 12:37:37 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sara Sharon , Luca Coelho , Kalle Valo , Sasha Levin Subject: [PATCH 5.9 045/105] iwlwifi: mvm: fix kernel panic in case of assert during CSA Date: Mon, 14 Dec 2020 18:28:19 +0100 Message-Id: <20201214172557.450802629@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214172555.280929671@linuxfoundation.org> References: <20201214172555.280929671@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sara Sharon [ Upstream commit fe56d05ee6c87f6a1a8c7267affd92c9438249cc ] During CSA, we briefly nullify the phy context, in __iwl_mvm_unassign_vif_chanctx. In case we have a FW assert right after it, it remains NULL though. We end up running into endless loop due to mac80211 trying repeatedly to move us to ASSOC state, and we keep returning -EINVAL. Later down the road we hit a kernel panic. Detect and avoid this endless loop. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20201107104557.d64de2c17bff.Iedd0d2afa20a2aacba5259a5cae31cb3a119a4eb@changeid Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 34362dc0d4612..f2d65e8384105 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3057,7 +3057,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, /* this would be a mac80211 bug ... but don't crash */ if (WARN_ON_ONCE(!mvmvif->phy_ctxt)) - return -EINVAL; + return test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) ? 0 : -EINVAL; /* * If we are in a STA removal flow and in DQA mode: -- 2.27.0