From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A955043AA9; Mon, 14 Oct 2024 15:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728918778; cv=none; b=SUxHqnqTTkFHDtktPQD4Cd+Ss8pYy+yO7SRaE+RoJDT3qM9qs0lESqj6DzBNYFgTJYmnZ7D3WHfgGaVib/+5ELVieO/NbqiVjln5ys27Wsxs+SRJqRzSPPqxafJZdtwZP5Jc7vf5P/+UIWIvTiuyPa06ZWPDT6gYCdWj6auLU2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728918778; c=relaxed/simple; bh=Qr9w3sJkluk+jTlEMHLlLx8KNkJsLMAEXp437gGOFFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ilOXowiWqJ5a+Iy2XvrIuanIvHEjwdDVsOF6Riatj4s1dMnOrX/gvdMlLVC7W0wOhnelw0+bLx/7faAQR2TRaZuyUgqVahsCOx8T/aiCLJqApjb9NJEkDBaDJpZlr+vBHoFcO0R3SVg0yM36J928L64NbNx0TjrTsKHe7Jxbbpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uNGmOju+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uNGmOju+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D6B0C4CEC3; Mon, 14 Oct 2024 15:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728918778; bh=Qr9w3sJkluk+jTlEMHLlLx8KNkJsLMAEXp437gGOFFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uNGmOju+4tVema2g7HHv0SdF4tyElHoTTEYwL4Igl9i92nmd/K9NlN2mSbr7v7PLD VDrrHy0yhbnlEGBXn2rzna7lVGm2avW03/qKVaiIcCieAdf0FTdf3qpZQLUkw7DF8z AvStgNoKNuYpmnhoU8340RjzxX4Gyv5wMDdPGC0Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kretschmer Mathias , Issam Hamdi , Johannes Berg , Sasha Levin Subject: [PATCH 6.1 421/798] wifi: cfg80211: Set correct chandef when starting CAC Date: Mon, 14 Oct 2024 16:16:15 +0200 Message-ID: <20241014141234.488790070@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141217.941104064@linuxfoundation.org> References: <20241014141217.941104064@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Issam Hamdi [ Upstream commit 20361712880396e44ce80aaeec2d93d182035651 ] When starting CAC in a mode other than AP mode, it return a "WARNING: CPU: 0 PID: 63 at cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211]" caused by the chandef.chan being null at the end of CAC. Solution: Ensure the channel definition is set for the different modes when starting CAC to avoid getting a NULL 'chan' at the end of CAC. Call Trace: ? show_regs.part.0+0x14/0x16 ? __warn+0x67/0xc0 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? report_bug+0xa7/0x130 ? exc_overflow+0x30/0x30 ? handle_bug+0x27/0x50 ? exc_invalid_op+0x18/0x60 ? handle_exception+0xf6/0xf6 ? exc_overflow+0x30/0x30 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? exc_overflow+0x30/0x30 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? regulatory_propagate_dfs_state.cold+0x1b/0x4c [cfg80211] ? cfg80211_propagate_cac_done_wk+0x1a/0x30 [cfg80211] ? process_one_work+0x165/0x280 ? worker_thread+0x120/0x3f0 ? kthread+0xc2/0xf0 ? process_one_work+0x280/0x280 ? kthread_complete_and_exit+0x20/0x20 ? ret_from_fork+0x19/0x24 Reported-by: Kretschmer Mathias Signed-off-by: Issam Hamdi Link: https://patch.msgid.link/20240816142418.3381951-1-ih@simonwunderlich.de [shorten subject, remove OCB, reorder cases to match previous list] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/nl80211.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index fe14997ce2c08..4df7a285a7de3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -9834,7 +9834,20 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms); if (!err) { - wdev->links[0].ap.chandef = chandef; + switch (wdev->iftype) { + case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_P2P_GO: + wdev->links[0].ap.chandef = chandef; + break; + case NL80211_IFTYPE_ADHOC: + wdev->u.ibss.chandef = chandef; + break; + case NL80211_IFTYPE_MESH_POINT: + wdev->u.mesh.chandef = chandef; + break; + default: + break; + } wdev->cac_started = true; wdev->cac_start_time = jiffies; wdev->cac_time_ms = cac_time_ms; -- 2.43.0