From f4134597a0efa48341416fbb76b667d706526c07 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Mon, 5 Oct 2026 11:44:50 +0300 Subject: [PATCH] wifi: cfg80211: nan: check Rx registration for NAN beacons Instant Communication requires user space to track the NAN beacons, so fail device registration when the device declares NAN Device support for Instant Communication but doesn't support Rx registration for beacon frames. Signed-off-by: Ilan Peer Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20261005084458.3666739-4-ilan.peer@intel.com Signed-off-by: Johannes Berg --- net/wireless/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/wireless/core.c b/net/wireless/core.c index 9176659345f0..45a1709cffe7 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -969,6 +969,13 @@ int wiphy_register(struct wiphy *wiphy) WIPHY_NAN_FLAGS_CONFIGURABLE_SYNC))) return -EINVAL; + /* Instant Communication requires user space to track NAN beacons */ + if (WARN_ON((wiphy->nan_capa.flags & WIPHY_NAN_FLAGS_INSTANT_COMM) && + (!wiphy->mgmt_stypes || + !(wiphy->mgmt_stypes[NL80211_IFTYPE_NAN].rx & + BIT(IEEE80211_STYPE_BEACON >> 4))))) + return -EINVAL; + if (WARN_ON(wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS))) return -EINVAL;