git: 66e318513452 - stable/14 - linuxKPI: 802.11: assert wihpy lock in lkpi_80211_mo_start()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 16 Jan 2026 19:40:26 UTC
The branch stable/14 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=66e3185134528714f0017fe52f110b0cd9e94c19
commit 66e3185134528714f0017fe52f110b0cd9e94c19
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-08-01 05:28:28 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-01-16 19:37:42 +0000
linuxKPI: 802.11: assert wihpy lock in lkpi_80211_mo_start()
Newer versions of Linux wifi drivers assert the wiphy lock in the
(*start)() path. Make sure we do too and do hold the wiphy lock.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 897cf423a39474096dc699f7b9d173e4a97d3510)
---
sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++++
sys/compat/linuxkpi/common/src/linux_80211_macops.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index ae919b7c5809..d0d32fbe88d8 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -3826,8 +3826,10 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
IMPROVE();
+ wiphy_lock(hw->wiphy);
error = lkpi_80211_mo_start(hw);
if (error != 0) {
+ wiphy_unlock(hw->wiphy);
ic_printf(ic, "%s: failed to start hw: %d\n", __func__, error);
mtx_destroy(&lvif->mtx);
free(lvif, M_80211_VAP);
@@ -3837,11 +3839,13 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
error = lkpi_80211_mo_add_interface(hw, vif);
if (error != 0) {
IMPROVE(); /* XXX-BZ mo_stop()? */
+ wiphy_unlock(hw->wiphy);
ic_printf(ic, "%s: failed to add interface: %d\n", __func__, error);
mtx_destroy(&lvif->mtx);
free(lvif, M_80211_VAP);
return (NULL);
}
+ wiphy_unlock(hw->wiphy);
LKPI_80211_LHW_LVIF_LOCK(lhw);
TAILQ_INSERT_TAIL(&lhw->lvif_head, lvif, lvif_entry);
diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
index c5720142401d..d848da433e1d 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
@@ -54,6 +54,8 @@ lkpi_80211_mo_start(struct ieee80211_hw *hw)
struct lkpi_hw *lhw;
int error;
+ lockdep_assert_wiphy(hw->wiphy);
+
lhw = HW_TO_LHW(hw);
if (lhw->ops->start == NULL) {
error = EOPNOTSUPP;