From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 96EDB3161A2; Wed, 23 Sep 2026 14:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790174332; cv=none; b=Xu3xoRN//InAzGyNCKBVbDiRgvu7zfT8iHSs+9Og4nDSl9eF+W+mQ6kqTQJkbOzTbqctAjk/QSBkS5V8dtlQ4e4YLAj+dLcW8BiBw+oGmhfAt+mXhnomi8cl+MobKp6059X1t2a8Tu9LcCnJMK4eXGgP3uEBybLn6G2D6BmH9Tg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790174332; c=relaxed/simple; bh=nDOfkGXlyctY/+fABzSFPKWA+ve4z1uUL/3m6takisA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jb44DsOwgpUMGosi726ybrvXiWpAibTIM3yRhkb2Sp+cdMOQNIkgP3/6KP/UKe4JHqt8Glo7JcLckxAe2MEl2oh09QFGOBvSKtySUCVhDOQMkqQo1U37GZesE5Y8A+kfPFiCkakKjnWf6ZGJHnHn5IPb1joxu9E1pgCeLM0WgT4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EAWWwj0s; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EAWWwj0s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2C8E1F000FF; Wed, 23 Sep 2026 14:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790174331; bh=OS8US60VUx6HMI9bftjEGVsZO5yGewcfMpQDY0VvQ1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EAWWwj0seQOTg6AEFca2JMzqJvCNAPhA2lrYlhFq3/FP3UDIUlnx11Uic6Y0Xg3cx Dc+U3MAiar19m++40/QTPL+qQd/8mqGayCP0UCOgd1Evt9tGn43Tx5FyGnr5WC6Tc8 cCmbHR+y+w2vmkDjurywpHJmAprm/iRuEVNFm/IA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+63a84ea9c0f57d6133fa@syzkaller.appspotmail.com, Johannes Berg , Sasha Levin Subject: [PATCH 6.18 081/398] wifi: mac80211: mesh: release the channel if start fails Date: Wed, 23 Sep 2026 16:02:35 +0200 Message-ID: <20260923140645.534383250@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140643.441954610@linuxfoundation.org> References: <20260923140643.441954610@linuxfoundation.org> User-Agent: quilt/0.69 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg [ Upstream commit ae97fff6495a8764bc0ef281cfe5444f701e527f ] ieee80211_join_mesh() acquires a channel context and then calls ieee80211_start_mesh(), which can fail. In that case, the chanctx isn't released then interface removal will attempt to unassign it after it's removed from the driver, hitting: wlan0: Failed check-sdata-in-driver check, flags: 0x0 WARNING: net/mac80211/driver-ops.c:366 at drv_unassign_vif_chanctx ieee80211_assign_link_chanctx __ieee80211_link_release_channel ieee80211_link_release_channel ieee80211_teardown_sdata unregister_netdevice_many_notify _cfg80211_unregister_wdev ieee80211_remove_interfaces ieee80211_unregister_hw mac80211_hwsim_del_radio hwsim_exit_net Correctly release the channel on start failures. Assisted-by: LLM Reported-by: syzbot+63a84ea9c0f57d6133fa@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=63a84ea9c0f57d6133fa Fixes: 2b5e19677592 ("mac80211: cache mesh beacon") Link: https://patch.msgid.link/20260908122838.201719-21-johannes@sipsolutions.net Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/cfg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 84e27d8a75ef1..2116485377c7e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2941,7 +2941,11 @@ static int ieee80211_join_mesh(struct wiphy *wiphy, struct net_device *dev, if (err) return err; - return ieee80211_start_mesh(sdata); + err = ieee80211_start_mesh(sdata); + if (err) + ieee80211_link_release_channel(&sdata->deflink); + + return err; } static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev) -- 2.53.0