aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-05-23 21:06:32 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-05-27 01:31:01 +0000
commitde65e20f8579e659adce86a1de05e194199427cf (patch)
tree071e9d43bbc87ebed5427228b4e8262eccaf2d4c
parent7669a182c232fcb9e1e4b627df2f306e7b0d23ea (diff)
LinuxKPI: 802.11: reset chanctx when recycling
When we no longer need a channel context and put it back on the reserved list, zero it for all but the vif so that we get the same state as if it was freshly allocated. Sponsored by: The FreeBSD Foundation Fixes: e62c92c0a5cf, 88cb1e17f471 (cherry picked from commit 8ead19207e56790bd4c64dba4ddbf2e0eb6922f7)
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index b9528295ad8e..efd1d9bae3cc 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2426,6 +2426,8 @@ lkpi_set_chanctx_conf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL);
lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
list_del(&lchanctx->entry);
+ memset(lchanctx, 0, sizeof(*lchanctx));
+ lchanctx->lvif = VIF_TO_LVIF(vif);
list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved);
}
@@ -2460,6 +2462,8 @@ lkpi_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
list_del(&lchanctx->entry);
lhw = HW_TO_LHW(hw);
+ memset(lchanctx, 0, sizeof(*lchanctx));
+ lchanctx->lvif = VIF_TO_LVIF(vif);
list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved);
}
@@ -6806,6 +6810,7 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw)
lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
}
list_del(&lchanctx->entry);
+ /* No need to reset the lchanctx here as we will free it below. */
list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved);
}
}