| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/07 22:18 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": [
"CFG80211",
"MAC80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_nan_set_non_evac_channels",
"nl80211_parse_non_evac_channel",
"cfg80211_nan_set_non_evac_channels",
"ieee80211_set_nan_non_evac_channels",
"ieee80211_nan_set_non_evac_channels",
"ieee80211_nan_find_evac_chan"
],
"KMSANReasoning": "The patch introduces the netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS and mac80211/cfg80211 handlers to mark certain NAN local schedule channels as non-evacuable.\n\nAnalysis of uninitialized memory risks:\n1. No kernel structures or data are copied to user space (it is a setter command returning only an error status), precluding kernel-to-user info leaks.\n2. All dynamic allocations (struct cfg80211_nan_non_evac_channels, nlattr array) are allocated using zeroing allocators (kzalloc, kcalloc) and automatically managed via __free(kfree).\n3. The new bool field `no_evacuate` in struct ieee80211_nan_channel is explicitly initialized (cleared to false and set to true when matching).\n4. No branching or conditional logic reads uninitialized stack or heap data.\n\nAny potential memory safety or locking issues in this patch (such as out-of-bounds access, invalid pointers, or concurrency issues) are fully covered by standard KASAN and LOCKDEP configurations. Hence, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false,
"Reasoning": "The patch introduces a new generic netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS to configure non-evacuable NAN schedule channels. It adds netlink attribute parsing, verification logic against the current local schedule in cfg80211, driver/stack ops in mac80211, and modifies channel evacuation selection in mac80211. This code is reachable from user space via nl80211 sockets and virtual wireless devices (such as mac80211_hwsim).",
"WorthFuzzing": true
} |
| 1/1 | 2026/09/07 22:18 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit a719a2aac1d73929d6baa057b81a9e9dfe4cc7c7\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Mon Sep 7 22:18:38 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/include/net/cfg80211.h b/include/net/cfg80211.h\nindex 6461a7bd0169d..59d76a0daf2cb 100644\n--- a/include/net/cfg80211.h\n+++ b/include/net/cfg80211.h\n@@ -4256,6 +4256,21 @@ struct cfg80211_nan_local_sched {\n \tstruct cfg80211_nan_channel nan_channels[] __counted_by(n_channels);\n };\n \n+/**\n+ * struct cfg80211_nan_non_evac_channels - NAN non-evacuable channels\n+ *\n+ * This struct defines the set of NAN local schedule channels that must not\n+ * be evacuated for concurrent operations.\n+ *\n+ * @n_channels: number of channel definitions in %chandefs.\n+ * @chandefs: array of channel definitions that must not be evacuated. Each\n+ *\tmust match a channel of the current local schedule.\n+ */\n+struct cfg80211_nan_non_evac_channels {\n+\tu8 n_channels;\n+\tstruct cfg80211_chan_def chandefs[] __counted_by(n_channels);\n+};\n+\n /**\n * struct cfg80211_nan_peer_map - NAN peer schedule map\n *\n@@ -5204,6 +5219,12 @@ struct mgmt_frame_regs {\n *\tschedule, the full new schedule is provided - partial updates are not\n *\tsupported, and the new schedule completely replaces the previous one.\n *\n+ * @nan_set_non_evac_channels: set the list of local schedule channels that\n+ *\tmust not be evacuated for concurrent operations. The provided list\n+ *\treplaces the previous set; channels of the current schedule that are\n+ *\tnot included become evacuable again. All provided channels are\n+ *\tguaranteed by cfg80211 to belong to the current local schedule.\n+ *\n * @set_multicast_to_unicast: configure multicast to unicast conversion for BSS\n *\n * @get_txq_stats: Get TXQ stats for interface or phy. If wdev is %NULL, this\n@@ -5590,6 +5611,9 @@ struct cfg80211_ops {\n \tint\t(*nan_set_peer_sched)(struct wiphy *wiphy,\n \t\t\t\t struct wireless_dev *wdev,\n \t\t\t\t struct cfg80211_nan_peer_sched *sched);\n+\tint\t(*nan_set_non_evac_channels)(struct wiphy *wiphy,\n+\t\t\t\t\t struct wireless_dev *wdev,\n+\t\t\t\t\t struct cfg80211_nan_non_evac_channels *channels);\n \tint\t(*set_multicast_to_unicast)(struct wiphy *wiphy,\n \t\t\t\t\t struct net_device *dev,\n \t\t\t\t\t const bool enabled);\ndiff --git a/include/net/mac80211.h b/include/net/mac80211.h\nindex 7bb4618065b67..33ff018c33ece 100644\n--- a/include/net/mac80211.h\n+++ b/include/net/mac80211.h\n@@ -923,12 +923,14 @@ struct ieee80211_bss_conf {\n * @channel_entry: the Channel Entry blob as defined in Wi-Fi Aware\n *\t(TM) 4.0 specification Table 100 (Channel Entry format for the NAN\n *\tAvailability attribute).\n+ * @no_evacuate: if set, this channel must not be evacuated\n */\n struct ieee80211_nan_channel {\n \tstruct ieee80211_chan_req chanreq;\n \tu8 needed_rx_chains;\n \tstruct ieee80211_chanctx_conf *chanctx_conf;\n \tu8 channel_entry[6];\n+\tbool no_evacuate;\n };\n \n /**\ndiff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h\nindex d8fefefc11a95..fb300b0c4a287 100644\n--- a/include/uapi/linux/nl80211.h\n+++ b/include/uapi/linux/nl80211.h\n@@ -1383,6 +1383,13 @@\n *\tfrom the device to perform an announced schedule update. See\n *\t%NL80211_ATTR_NAN_SCHED_DEFERRED for more details.\n *\tIf not set, the schedule should be applied immediately.\n+ *\tSetting a new schedule is always allowed and is never treated as an\n+ *\tevacuation, even if it removes channels that were previously marked as\n+ *\tnon-evacuable with %NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS. The\n+ *\tnon-evacuable marking is a per-channel property of the schedule:\n+ *\tchannels that remain in the new schedule keep their marking, channels\n+ *\tthat are removed simply lose it, and newly added channels are\n+ *\tevacuable by default.\n * @NL80211_CMD_NAN_SCHED_UPDATE_DONE: Event sent to user space to notify that\n *\ta deferred local NAN schedule update (requested with\n *\t%NL80211_CMD_NAN_SET_LOCAL_SCHED and %NL80211_ATTR_NAN_SCHED_DEFERRED)\n@@ -1427,6 +1434,28 @@\n * @NL80211_CMD_STOP_PD: Stop the PD operation, identified by\n *\tits %NL80211_ATTR_WDEV interface.\n *\n+ * @NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS: Set the list of NAN local schedule\n+ *\tchannels that must not be evacuated. NAN must be operational\n+ *\t(%NL80211_CMD_START_NAN was executed) and a local schedule must have\n+ *\tbeen set (%NL80211_CMD_NAN_SET_LOCAL_SCHED). The command carries zero\n+ *\tor more nested %NL80211_ATTR_NAN_CHANNEL attributes, each identifying a\n+ *\tchannel (by its channel definition) of the current local schedule that\n+ *\tmust not be evacuated for concurrent operations. The provided list\n+ *\treplaces the previous set of non-evacuable channels; channels of the\n+ *\tcurrent schedule that are not included become evacuable again. All\n+ *\tprovided channels must exist in the current local schedule, otherwise\n+ *\tthe command fails. This is used to protect channels carrying NDC or\n+ *\timmutable schedules, whose evacuation would break existing NDP\n+ *\tconnections.\n+ *\tThe non-evacuable marking is a per-channel property of the current\n+ *\tlocal schedule and only affects evacuation for concurrent operations;\n+ *\tit does not prevent the schedule itself from being changed. Removing a\n+ *\tchannel from the schedule with %NL80211_CMD_NAN_SET_LOCAL_SCHED is a\n+ *\tuser-initiated change, not an evacuation, and is allowed even for a\n+ *\tnon-evacuable channel. Across a schedule update, channels that remain\n+ *\tkeep their non-evacuable marking, removed channels lose it, and newly\n+ *\tadded channels are evacuable by default; issue this command again to\n+ *\tchange the non-evacuable set.\n * @NL80211_CMD_MAX: highest used command number\n * @__NL80211_CMD_AFTER_LAST: internal use\n */\n@@ -1705,6 +1734,8 @@ enum nl80211_commands {\n \tNL80211_CMD_START_PD,\n \tNL80211_CMD_STOP_PD,\n \n+\tNL80211_CMD_NAN_SET_NON_EVAC_CHANNELS,\n+\n \t/* add new commands above here */\n \n \t/* used to define NL80211_CMD_MAX below */\ndiff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c\nindex 23f4f9ec86d0a..cdcf1f0577077 100644\n--- a/net/mac80211/cfg.c\n+++ b/net/mac80211/cfg.c\n@@ -5973,6 +5973,18 @@ ieee80211_set_peer_nan_sched(struct wiphy *wiphy,\n \treturn ieee80211_nan_set_peer_sched(sdata, sched);\n }\n \n+static int\n+ieee80211_set_nan_non_evac_channels(struct wiphy *wiphy,\n+\t\t\t\t struct wireless_dev *wdev,\n+\t\t\t\t struct cfg80211_nan_non_evac_channels *channels)\n+{\n+\tstruct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);\n+\n+\tlockdep_assert_wiphy(wiphy);\n+\n+\treturn ieee80211_nan_set_non_evac_channels(sdata, channels);\n+}\n+\n const struct cfg80211_ops mac80211_config_ops = {\n \t.add_virtual_intf = ieee80211_add_iface,\n \t.del_virtual_intf = ieee80211_del_iface,\n@@ -6091,4 +6103,5 @@ const struct cfg80211_ops mac80211_config_ops = {\n \t.set_epcs = ieee80211_set_epcs,\n \t.nan_set_local_sched = ieee80211_set_local_nan_sched,\n \t.nan_set_peer_sched = ieee80211_set_peer_nan_sched,\n+\t.nan_set_non_evac_channels = ieee80211_set_nan_non_evac_channels,\n };\ndiff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h\nindex 53b0b08d34597..929fc8930a35e 100644\n--- a/net/mac80211/ieee80211_i.h\n+++ b/net/mac80211/ieee80211_i.h\n@@ -2087,6 +2087,8 @@ int ieee80211_nan_set_local_sched(struct ieee80211_sub_if_data *sdata,\n \t\t\t\t struct cfg80211_nan_local_sched *sched);\n int ieee80211_nan_set_peer_sched(struct ieee80211_sub_if_data *sdata,\n \t\t\t\t struct cfg80211_nan_peer_sched *sched);\n+int ieee80211_nan_set_non_evac_channels(struct ieee80211_sub_if_data *sdata,\n+\t\t\t\t\tstruct cfg80211_nan_non_evac_channels *channels);\n void ieee80211_nan_free_peer_sched(struct ieee80211_nan_peer_sched *sched);\n void ieee80211_nan_update_ndi_carrier(struct ieee80211_sub_if_data *ndi_sdata);\n struct ieee80211_nan_channel *\ndiff --git a/net/mac80211/nan.c b/net/mac80211/nan.c\nindex 19e08661be43a..38bd105121acf 100644\n--- a/net/mac80211/nan.c\n+++ b/net/mac80211/nan.c\n@@ -248,6 +248,35 @@ ieee80211_nan_find_free_channel(struct ieee80211_nan_sched_cfg *sched_cfg)\n \treturn NULL;\n }\n \n+int\n+ieee80211_nan_set_non_evac_channels(struct ieee80211_sub_if_data *sdata,\n+\t\t\t\t struct cfg80211_nan_non_evac_channels *channels)\n+{\n+\tstruct ieee80211_nan_sched_cfg *sched_cfg = \u0026sdata-\u003evif.cfg.nan_sched;\n+\n+\t/*\n+\t * cfg80211 already validated that all provided channels belong to the\n+\t * current schedule, so just clear all non-evacuable flags and set the\n+\t * ones in the list.\n+\t */\n+\tfor (int j = 0; j \u003c ARRAY_SIZE(sched_cfg-\u003echannels); j++)\n+\t\tsched_cfg-\u003echannels[j].no_evacuate = false;\n+\n+\tfor (int i = 0; i \u003c channels-\u003en_channels; i++) {\n+\t\tfor (int j = 0; j \u003c ARRAY_SIZE(sched_cfg-\u003echannels); j++) {\n+\t\t\tif (!sched_cfg-\u003echannels[j].chanreq.oper.chan)\n+\t\t\t\tcontinue;\n+\t\t\tif (cfg80211_chandef_identical(\u0026sched_cfg-\u003echannels[j].chanreq.oper,\n+\t\t\t\t\t\t \u0026channels-\u003echandefs[i])) {\n+\t\t\t\tsched_cfg-\u003echannels[j].no_evacuate = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n int ieee80211_nan_set_local_sched(struct ieee80211_sub_if_data *sdata,\n \t\t\t\t struct cfg80211_nan_local_sched *sched)\n {\n@@ -786,6 +815,10 @@ ieee80211_nan_find_evac_chan(struct ieee80211_local *local,\n \n \t\tusable_channels++;\n \n+\t\t/* No-evacuate channel is usable but cannot be evacuated */\n+\t\tif (chan-\u003eno_evacuate)\n+\t\t\tcontinue;\n+\n \t\tchan_ctx = container_of(chan-\u003echanctx_conf,\n \t\t\t\t\tstruct ieee80211_chanctx, conf);\n \ndiff --git a/net/wireless/core.c b/net/wireless/core.c\nindex d13310fef691a..2f46243773f94 100644\n--- a/net/wireless/core.c\n+++ b/net/wireless/core.c\n@@ -325,6 +325,41 @@ int cfg80211_nan_set_local_schedule(struct cfg80211_registered_device *rdev,\n \treturn 0;\n }\n \n+int cfg80211_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,\n+\t\t\t\t struct wireless_dev *wdev,\n+\t\t\t\t struct cfg80211_nan_non_evac_channels *channels)\n+{\n+\tlockdep_assert_held(\u0026rdev-\u003ewiphy.mtx);\n+\n+\tif (wdev-\u003eiftype != NL80211_IFTYPE_NAN || !wdev_running(wdev))\n+\t\treturn -EINVAL;\n+\n+\t/*\n+\t * Don't allow updating the non-evacuable channels while a deferred\n+\t * schedule update is pending, as the set of channels may still change.\n+\t */\n+\tif (wdev-\u003eu.nan.sched_update_pending)\n+\t\treturn -EBUSY;\n+\n+\t/* All provided channels must belong to the current local schedule. */\n+\tfor (int i = 0; i \u003c channels-\u003en_channels; i++) {\n+\t\tbool found = false;\n+\n+\t\tfor (int j = 0; j \u003c wdev-\u003eu.nan.n_channels; j++) {\n+\t\t\tif (cfg80211_chandef_identical(\u0026wdev-\u003eu.nan.chandefs[j],\n+\t\t\t\t\t\t \u0026channels-\u003echandefs[i])) {\n+\t\t\t\tfound = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (!found)\n+\t\t\treturn -ENOENT;\n+\t}\n+\n+\treturn rdev_nan_set_non_evac_channels(rdev, wdev, channels);\n+}\n+\n void cfg80211_stop_pd(struct cfg80211_registered_device *rdev,\n \t\t struct wireless_dev *wdev)\n {\ndiff --git a/net/wireless/core.h b/net/wireless/core.h\nindex b4610f6685dcb..4ee48b9370800 100644\n--- a/net/wireless/core.h\n+++ b/net/wireless/core.h\n@@ -565,6 +565,10 @@ int cfg80211_nan_set_local_schedule(struct cfg80211_registered_device *rdev,\n \t\t\t\t struct wireless_dev *wdev,\n \t\t\t\t struct cfg80211_nan_local_sched *sched);\n \n+int cfg80211_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,\n+\t\t\t\t struct wireless_dev *wdev,\n+\t\t\t\t struct cfg80211_nan_non_evac_channels *channels);\n+\n struct cfg80211_internal_bss *\n cfg80211_bss_update(struct cfg80211_registered_device *rdev,\n \t\t struct cfg80211_internal_bss *tmp,\ndiff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c\nindex e585da1d79c9e..f44036ad43fb5 100644\n--- a/net/wireless/nl80211.c\n+++ b/net/wireless/nl80211.c\n@@ -17763,6 +17763,69 @@ static int nl80211_nan_set_local_sched(struct sk_buff *skb,\n \treturn cfg80211_nan_set_local_schedule(rdev, wdev, sched);\n }\n \n+static int\n+nl80211_parse_non_evac_channel(struct cfg80211_registered_device *rdev,\n+\t\t\t struct nlattr *channel, struct genl_info *info,\n+\t\t\t struct cfg80211_chan_def *chandef)\n+{\n+\tstruct nlattr **channel_parsed __free(kfree) =\n+\t\tkcalloc(NL80211_ATTR_MAX + 1, sizeof(*channel_parsed),\n+\t\t\tGFP_KERNEL);\n+\tint ret;\n+\n+\tif (!channel_parsed)\n+\t\treturn -ENOMEM;\n+\n+\tret = nla_parse_nested(channel_parsed, NL80211_ATTR_MAX, channel, NULL,\n+\t\t\t info-\u003eextack);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn nl80211_parse_chandef(rdev, info-\u003eextack, channel_parsed,\n+\t\t\t\t chandef, false);\n+}\n+\n+static int nl80211_nan_set_non_evac_channels(struct sk_buff *skb,\n+\t\t\t\t\t struct genl_info *info)\n+{\n+\tstruct cfg80211_registered_device *rdev = info-\u003euser_ptr[0];\n+\tstruct wireless_dev *wdev = info-\u003euser_ptr[1];\n+\tint rem, i = 0, n_channels = 0;\n+\tstruct nlattr *channel;\n+\n+\tif (wdev-\u003eiftype != NL80211_IFTYPE_NAN)\n+\t\treturn -EOPNOTSUPP;\n+\n+\tif (!wdev_running(wdev))\n+\t\treturn -ENOTCONN;\n+\n+\t/* Count how many channel attributes we got */\n+\tnlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,\n+\t\t\t\t info-\u003enlhdr, GENL_HDRLEN, rem)\n+\t\tn_channels++;\n+\n+\tstruct cfg80211_nan_non_evac_channels *channels __free(kfree) =\n+\t\tkzalloc(struct_size(channels, chandefs, n_channels),\n+\t\t\tGFP_KERNEL);\n+\tif (!channels)\n+\t\treturn -ENOMEM;\n+\n+\tchannels-\u003en_channels = n_channels;\n+\n+\tnlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,\n+\t\t\t\t info-\u003enlhdr, GENL_HDRLEN, rem) {\n+\t\tint ret;\n+\n+\t\tret = nl80211_parse_non_evac_channel(rdev, channel, info,\n+\t\t\t\t\t\t \u0026channels-\u003echandefs[i]);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t\ti++;\n+\t}\n+\n+\treturn cfg80211_nan_set_non_evac_channels(rdev, wdev, channels);\n+}\n+\n static int nl80211_get_protocol_features(struct sk_buff *skb,\n \t\t\t\t\t struct genl_info *info)\n {\n@@ -20619,6 +20682,12 @@ static const struct genl_small_ops nl80211_small_ops[] = {\n \t\t.flags = GENL_ADMIN_PERM,\n \t\t.internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),\n \t},\n+\t{\n+\t\t.cmd = NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS,\n+\t\t.doit = nl80211_nan_set_non_evac_channels,\n+\t\t.flags = GENL_ADMIN_PERM,\n+\t\t.internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),\n+\t},\n };\n \n static struct genl_family nl80211_fam __ro_after_init = {\ndiff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h\nindex 46849fe8d0b39..269258c94a42a 100644\n--- a/net/wireless/rdev-ops.h\n+++ b/net/wireless/rdev-ops.h\n@@ -1093,6 +1093,23 @@ rdev_nan_set_peer_sched(struct cfg80211_registered_device *rdev,\n \treturn ret;\n }\n \n+static inline int\n+rdev_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,\n+\t\t\t struct wireless_dev *wdev,\n+\t\t\t struct cfg80211_nan_non_evac_channels *channels)\n+{\n+\tint ret;\n+\n+\ttrace_rdev_nan_set_non_evac_channels(\u0026rdev-\u003ewiphy, wdev, channels);\n+\tif (rdev-\u003eops-\u003enan_set_non_evac_channels)\n+\t\tret = rdev-\u003eops-\u003enan_set_non_evac_channels(\u0026rdev-\u003ewiphy, wdev,\n+\t\t\t\t\t\t\t channels);\n+\telse\n+\t\tret = -EOPNOTSUPP;\n+\ttrace_rdev_return_int(\u0026rdev-\u003ewiphy, ret);\n+\treturn ret;\n+}\n+\n static inline int rdev_start_pd(struct cfg80211_registered_device *rdev,\n \t\t\t\tstruct wireless_dev *wdev)\n {\ndiff --git a/net/wireless/trace.h b/net/wireless/trace.h\nindex 8c2a91b85c396..435dc58cafbed 100644\n--- a/net/wireless/trace.h\n+++ b/net/wireless/trace.h\n@@ -2483,6 +2483,31 @@ TRACE_EVENT(rdev_nan_set_peer_sched,\n \t)\n );\n \n+TRACE_EVENT(rdev_nan_set_non_evac_channels,\n+\tTP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,\n+\t\t struct cfg80211_nan_non_evac_channels *channels),\n+\tTP_ARGS(wiphy, wdev, channels),\n+\tTP_STRUCT__entry(\n+\t\tWIPHY_ENTRY\n+\t\tWDEV_ENTRY\n+\t\t__field(u8, n_channels)\n+\t\t__dynamic_array(u32, freqs, channels-\u003en_channels)\n+\t),\n+\tTP_fast_assign(\n+\t\tu32 *freqs = __get_dynamic_array(freqs);\n+\n+\t\tWIPHY_ASSIGN;\n+\t\tWDEV_ASSIGN;\n+\t\t__entry-\u003en_channels = channels-\u003en_channels;\n+\t\tfor (int i = 0; i \u003c channels-\u003en_channels; i++)\n+\t\t\tfreqs[i] = channels-\u003echandefs[i].chan-\u003ecenter_freq;\n+\t),\n+\tTP_printk(WIPHY_PR_FMT \", \" WDEV_PR_FMT \", n_channels: %u, freqs: %s\",\n+\t\t WIPHY_PR_ARG, WDEV_PR_ARG, __entry-\u003en_channels,\n+\t\t __print_array(__get_dynamic_array(freqs),\n+\t\t\t\t__entry-\u003en_channels, sizeof(u32)))\n+);\n+\n TRACE_EVENT(rdev_set_mac_acl,\n \tTP_PROTO(struct wiphy *wiphy, struct net_device *netdev,\n \t\t struct cfg80211_acl_data *params),\n"
} |
| 2/1 | 2026/09/07 22:18 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": [
"CFG80211",
"MAC80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_nan_set_non_evac_channels",
"nl80211_parse_non_evac_channel",
"cfg80211_nan_set_non_evac_channels",
"ieee80211_set_nan_non_evac_channels",
"ieee80211_nan_set_non_evac_channels",
"ieee80211_nan_find_evac_chan"
],
"Reasoning": "The patch introduces a new generic netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS to configure non-evacuable NAN schedule channels. It adds netlink attribute parsing, verification logic against the current local schedule in cfg80211, driver/stack ops in mac80211, and modifies channel evacuation selection in mac80211. This code is reachable from user space via nl80211 sockets and virtual wireless devices (such as mac80211_hwsim).",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit a719a2aac1d73929d6baa057b81a9e9dfe4cc7c7
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Sep 7 22:18:38 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6461a7bd0169d..59d76a0daf2cb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4256,6 +4256,21 @@ struct cfg80211_nan_local_sched {
struct cfg80211_nan_channel nan_channels[] __counted_by(n_channels);
};
+/**
+ * struct cfg80211_nan_non_evac_channels - NAN non-evacuable channels
+ *
+ * This struct defines the set of NAN local schedule channels that must not
+ * be evacuated for concurrent operations.
+ *
+ * @n_channels: number of channel definitions in %chandefs.
+ * @chandefs: array of channel definitions that must not be evacuated. Each
+ * must match a channel of the current local schedule.
+ */
+struct cfg80211_nan_non_evac_channels {
+ u8 n_channels;
+ struct cfg80211_chan_def chandefs[] __counted_by(n_channels);
+};
+
/**
* struct cfg80211_nan_peer_map - NAN peer schedule map
*
@@ -5204,6 +5219,12 @@ struct mgmt_frame_regs {
* schedule, the full new schedule is provided - partial updates are not
* supported, and the new schedule completely replaces the previous one.
*
+ * @nan_set_non_evac_channels: set the list of local schedule channels that
+ * must not be evacuated for concurrent operations. The provided list
+ * replaces the previous set; channels of the current schedule that are
+ * not included become evacuable again. All provided channels are
+ * guaranteed by cfg80211 to belong to the current local schedule.
+ *
* @set_multicast_to_unicast: configure multicast to unicast conversion for BSS
*
* @get_txq_stats: Get TXQ stats for interface or phy. If wdev is %NULL, this
@@ -5590,6 +5611,9 @@ struct cfg80211_ops {
int (*nan_set_peer_sched)(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct cfg80211_nan_peer_sched *sched);
+ int (*nan_set_non_evac_channels)(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels);
int (*set_multicast_to_unicast)(struct wiphy *wiphy,
struct net_device *dev,
const bool enabled);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7bb4618065b67..33ff018c33ece 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -923,12 +923,14 @@ struct ieee80211_bss_conf {
* @channel_entry: the Channel Entry blob as defined in Wi-Fi Aware
* (TM) 4.0 specification Table 100 (Channel Entry format for the NAN
* Availability attribute).
+ * @no_evacuate: if set, this channel must not be evacuated
*/
struct ieee80211_nan_channel {
struct ieee80211_chan_req chanreq;
u8 needed_rx_chains;
struct ieee80211_chanctx_conf *chanctx_conf;
u8 channel_entry[6];
+ bool no_evacuate;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index d8fefefc11a95..fb300b0c4a287 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1383,6 +1383,13 @@
* from the device to perform an announced schedule update. See
* %NL80211_ATTR_NAN_SCHED_DEFERRED for more details.
* If not set, the schedule should be applied immediately.
+ * Setting a new schedule is always allowed and is never treated as an
+ * evacuation, even if it removes channels that were previously marked as
+ * non-evacuable with %NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS. The
+ * non-evacuable marking is a per-channel property of the schedule:
+ * channels that remain in the new schedule keep their marking, channels
+ * that are removed simply lose it, and newly added channels are
+ * evacuable by default.
* @NL80211_CMD_NAN_SCHED_UPDATE_DONE: Event sent to user space to notify that
* a deferred local NAN schedule update (requested with
* %NL80211_CMD_NAN_SET_LOCAL_SCHED and %NL80211_ATTR_NAN_SCHED_DEFERRED)
@@ -1427,6 +1434,28 @@
* @NL80211_CMD_STOP_PD: Stop the PD operation, identified by
* its %NL80211_ATTR_WDEV interface.
*
+ * @NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS: Set the list of NAN local schedule
+ * channels that must not be evacuated. NAN must be operational
+ * (%NL80211_CMD_START_NAN was executed) and a local schedule must have
+ * been set (%NL80211_CMD_NAN_SET_LOCAL_SCHED). The command carries zero
+ * or more nested %NL80211_ATTR_NAN_CHANNEL attributes, each identifying a
+ * channel (by its channel definition) of the current local schedule that
+ * must not be evacuated for concurrent operations. The provided list
+ * replaces the previous set of non-evacuable channels; channels of the
+ * current schedule that are not included become evacuable again. All
+ * provided channels must exist in the current local schedule, otherwise
+ * the command fails. This is used to protect channels carrying NDC or
+ * immutable schedules, whose evacuation would break existing NDP
+ * connections.
+ * The non-evacuable marking is a per-channel property of the current
+ * local schedule and only affects evacuation for concurrent operations;
+ * it does not prevent the schedule itself from being changed. Removing a
+ * channel from the schedule with %NL80211_CMD_NAN_SET_LOCAL_SCHED is a
+ * user-initiated change, not an evacuation, and is allowed even for a
+ * non-evacuable channel. Across a schedule update, channels that remain
+ * keep their non-evacuable marking, removed channels lose it, and newly
+ * added channels are evacuable by default; issue this command again to
+ * change the non-evacuable set.
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1705,6 +1734,8 @@ enum nl80211_commands {
NL80211_CMD_START_PD,
NL80211_CMD_STOP_PD,
+ NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 23f4f9ec86d0a..cdcf1f0577077 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -5973,6 +5973,18 @@ ieee80211_set_peer_nan_sched(struct wiphy *wiphy,
return ieee80211_nan_set_peer_sched(sdata, sched);
}
+static int
+ieee80211_set_nan_non_evac_channels(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+ lockdep_assert_wiphy(wiphy);
+
+ return ieee80211_nan_set_non_evac_channels(sdata, channels);
+}
+
const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -6091,4 +6103,5 @@ const struct cfg80211_ops mac80211_config_ops = {
.set_epcs = ieee80211_set_epcs,
.nan_set_local_sched = ieee80211_set_local_nan_sched,
.nan_set_peer_sched = ieee80211_set_peer_nan_sched,
+ .nan_set_non_evac_channels = ieee80211_set_nan_non_evac_channels,
};
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 53b0b08d34597..929fc8930a35e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2087,6 +2087,8 @@ int ieee80211_nan_set_local_sched(struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_local_sched *sched);
int ieee80211_nan_set_peer_sched(struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_peer_sched *sched);
+int ieee80211_nan_set_non_evac_channels(struct ieee80211_sub_if_data *sdata,
+ struct cfg80211_nan_non_evac_channels *channels);
void ieee80211_nan_free_peer_sched(struct ieee80211_nan_peer_sched *sched);
void ieee80211_nan_update_ndi_carrier(struct ieee80211_sub_if_data *ndi_sdata);
struct ieee80211_nan_channel *
diff --git a/net/mac80211/nan.c b/net/mac80211/nan.c
index 19e08661be43a..38bd105121acf 100644
--- a/net/mac80211/nan.c
+++ b/net/mac80211/nan.c
@@ -248,6 +248,35 @@ ieee80211_nan_find_free_channel(struct ieee80211_nan_sched_cfg *sched_cfg)
return NULL;
}
+int
+ieee80211_nan_set_non_evac_channels(struct ieee80211_sub_if_data *sdata,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ struct ieee80211_nan_sched_cfg *sched_cfg = &sdata->vif.cfg.nan_sched;
+
+ /*
+ * cfg80211 already validated that all provided channels belong to the
+ * current schedule, so just clear all non-evacuable flags and set the
+ * ones in the list.
+ */
+ for (int j = 0; j < ARRAY_SIZE(sched_cfg->channels); j++)
+ sched_cfg->channels[j].no_evacuate = false;
+
+ for (int i = 0; i < channels->n_channels; i++) {
+ for (int j = 0; j < ARRAY_SIZE(sched_cfg->channels); j++) {
+ if (!sched_cfg->channels[j].chanreq.oper.chan)
+ continue;
+ if (cfg80211_chandef_identical(&sched_cfg->channels[j].chanreq.oper,
+ &channels->chandefs[i])) {
+ sched_cfg->channels[j].no_evacuate = true;
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
int ieee80211_nan_set_local_sched(struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_local_sched *sched)
{
@@ -786,6 +815,10 @@ ieee80211_nan_find_evac_chan(struct ieee80211_local *local,
usable_channels++;
+ /* No-evacuate channel is usable but cannot be evacuated */
+ if (chan->no_evacuate)
+ continue;
+
chan_ctx = container_of(chan->chanctx_conf,
struct ieee80211_chanctx, conf);
diff --git a/net/wireless/core.c b/net/wireless/core.c
index d13310fef691a..2f46243773f94 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -325,6 +325,41 @@ int cfg80211_nan_set_local_schedule(struct cfg80211_registered_device *rdev,
return 0;
}
+int cfg80211_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ lockdep_assert_held(&rdev->wiphy.mtx);
+
+ if (wdev->iftype != NL80211_IFTYPE_NAN || !wdev_running(wdev))
+ return -EINVAL;
+
+ /*
+ * Don't allow updating the non-evacuable channels while a deferred
+ * schedule update is pending, as the set of channels may still change.
+ */
+ if (wdev->u.nan.sched_update_pending)
+ return -EBUSY;
+
+ /* All provided channels must belong to the current local schedule. */
+ for (int i = 0; i < channels->n_channels; i++) {
+ bool found = false;
+
+ for (int j = 0; j < wdev->u.nan.n_channels; j++) {
+ if (cfg80211_chandef_identical(&wdev->u.nan.chandefs[j],
+ &channels->chandefs[i])) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ return -ENOENT;
+ }
+
+ return rdev_nan_set_non_evac_channels(rdev, wdev, channels);
+}
+
void cfg80211_stop_pd(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
diff --git a/net/wireless/core.h b/net/wireless/core.h
index b4610f6685dcb..4ee48b9370800 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -565,6 +565,10 @@ int cfg80211_nan_set_local_schedule(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
struct cfg80211_nan_local_sched *sched);
+int cfg80211_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels);
+
struct cfg80211_internal_bss *
cfg80211_bss_update(struct cfg80211_registered_device *rdev,
struct cfg80211_internal_bss *tmp,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e585da1d79c9e..f44036ad43fb5 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -17763,6 +17763,69 @@ static int nl80211_nan_set_local_sched(struct sk_buff *skb,
return cfg80211_nan_set_local_schedule(rdev, wdev, sched);
}
+static int
+nl80211_parse_non_evac_channel(struct cfg80211_registered_device *rdev,
+ struct nlattr *channel, struct genl_info *info,
+ struct cfg80211_chan_def *chandef)
+{
+ struct nlattr **channel_parsed __free(kfree) =
+ kcalloc(NL80211_ATTR_MAX + 1, sizeof(*channel_parsed),
+ GFP_KERNEL);
+ int ret;
+
+ if (!channel_parsed)
+ return -ENOMEM;
+
+ ret = nla_parse_nested(channel_parsed, NL80211_ATTR_MAX, channel, NULL,
+ info->extack);
+ if (ret)
+ return ret;
+
+ return nl80211_parse_chandef(rdev, info->extack, channel_parsed,
+ chandef, false);
+}
+
+static int nl80211_nan_set_non_evac_channels(struct sk_buff *skb,
+ struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+ int rem, i = 0, n_channels = 0;
+ struct nlattr *channel;
+
+ if (wdev->iftype != NL80211_IFTYPE_NAN)
+ return -EOPNOTSUPP;
+
+ if (!wdev_running(wdev))
+ return -ENOTCONN;
+
+ /* Count how many channel attributes we got */
+ nlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,
+ info->nlhdr, GENL_HDRLEN, rem)
+ n_channels++;
+
+ struct cfg80211_nan_non_evac_channels *channels __free(kfree) =
+ kzalloc(struct_size(channels, chandefs, n_channels),
+ GFP_KERNEL);
+ if (!channels)
+ return -ENOMEM;
+
+ channels->n_channels = n_channels;
+
+ nlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,
+ info->nlhdr, GENL_HDRLEN, rem) {
+ int ret;
+
+ ret = nl80211_parse_non_evac_channel(rdev, channel, info,
+ &channels->chandefs[i]);
+ if (ret)
+ return ret;
+ i++;
+ }
+
+ return cfg80211_nan_set_non_evac_channels(rdev, wdev, channels);
+}
+
static int nl80211_get_protocol_features(struct sk_buff *skb,
struct genl_info *info)
{
@@ -20619,6 +20682,12 @@ static const struct genl_small_ops nl80211_small_ops[] = {
.flags = GENL_ADMIN_PERM,
.internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),
},
+ {
+ .cmd = NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS,
+ .doit = nl80211_nan_set_non_evac_channels,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),
+ },
};
static struct genl_family nl80211_fam __ro_after_init = {
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 46849fe8d0b39..269258c94a42a 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1093,6 +1093,23 @@ rdev_nan_set_peer_sched(struct cfg80211_registered_device *rdev,
return ret;
}
+static inline int
+rdev_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ int ret;
+
+ trace_rdev_nan_set_non_evac_channels(&rdev->wiphy, wdev, channels);
+ if (rdev->ops->nan_set_non_evac_channels)
+ ret = rdev->ops->nan_set_non_evac_channels(&rdev->wiphy, wdev,
+ channels);
+ else
+ ret = -EOPNOTSUPP;
+ trace_rdev_return_int(&rdev->wiphy, ret);
+ return ret;
+}
+
static inline int rdev_start_pd(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 8c2a91b85c396..435dc58cafbed 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2483,6 +2483,31 @@ TRACE_EVENT(rdev_nan_set_peer_sched,
)
);
+TRACE_EVENT(rdev_nan_set_non_evac_channels,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels),
+ TP_ARGS(wiphy, wdev, channels),
+ TP_STRUCT__entry(
+ WIPHY_ENTRY
+ WDEV_ENTRY
+ __field(u8, n_channels)
+ __dynamic_array(u32, freqs, channels->n_channels)
+ ),
+ TP_fast_assign(
+ u32 *freqs = __get_dynamic_array(freqs);
+
+ WIPHY_ASSIGN;
+ WDEV_ASSIGN;
+ __entry->n_channels = channels->n_channels;
+ for (int i = 0; i < channels->n_channels; i++)
+ freqs[i] = channels->chandefs[i].chan->center_freq;
+ ),
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", n_channels: %u, freqs: %s",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->n_channels,
+ __print_array(__get_dynamic_array(freqs),
+ __entry->n_channels, sizeof(u32)))
+);
+
TRACE_EVENT(rdev_set_mac_acl,
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
struct cfg80211_acl_data *params),
|
| 3/2 | 2026/09/07 22:18 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 9374 output: 32 thoughts: 578 Thoughts: **Analyzing the Patch for Syzkaller Fuzzing Potential** Okay, let's break this down. My initial thought is to figure out if this patch is a good target for syzkaller. From the file list, I see a few key areas that are interesting to me: First, it touches `cfg80211` and `mac80211` heavily, specifically related to NAN (Neighbor Awareness Networking). This immediately raises a flag – both are core wireless networking components, which are notorious for complexity and potential bugs. I'm seeing structures like `cfg80211_nan_non_evac_channels`, callbacks, and `NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS`. This `NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS` is key because netlink interfaces are prime syzkaller targets. The presence of `mac80211_hwsim` is intriguing. That virtual WiFi driver is crucial for syzkaller. If this patch interacts with `mac80211_hwsim`, then we're in luck because we can readily test it without needing physical hardware. I need to quickly check if `mac80211_hwsim` supports NAN, or if mac80211 even supports those NAN commands via nl80211. I should also check for any relevant Kconfig dependencies that might make this code conditionally compiled or otherwise not reachable. The fact that `nl80211` is also involved is a big plus. Syzkaller already heavily fuzzed `nl80211`, so getting this new functionality exposed through that interface is a good sign. The `nl80211_parse_non_evac_channel` and `nl80211_nan_set_non_evac_channels` functions look particularly interesting from a fuzzing perspective. To quickly assess reachability, I'll need to use my usual tools to do some greps on the kernel source to identify call sites and potential entry points. |
| 4/2 | 2026/09/07 22:18 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_CFG80211",
"PathPrefix": "net/wireless"
}Results: {
"Output": "net/wireless/Makefile-1-# SPDX-License-Identifier: GPL-2.0\nnet/wireless/Makefile:2:obj-$(CONFIG_CFG80211) += cfg80211.o\nnet/wireless/Makefile-3-obj-y += tests/\n--\nnet/wireless/Makefile=12=cfg80211-$(CONFIG_OF) += of.o\nnet/wireless/Makefile:13:cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o\nnet/wireless/Makefile:14:cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o\nnet/wireless/Makefile-15-\nnet/wireless/Makefile=16=CFLAGS_trace.o := -I$(src)\nnet/wireless/Makefile-17-\nnet/wireless/Makefile:18:cfg80211-$(CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS) += shipped-certs.o\nnet/wireless/Makefile:19:ifneq ($(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR),)\nnet/wireless/Makefile-20-cfg80211-y += extra-certs.o\n--\nnet/wireless/Makefile=23=$(obj)/shipped-certs.c: $(sort $(wildcard $(src)/certs/*.hex))\n--\nnet/wireless/Makefile-31-\nnet/wireless/Makefile:32:$(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR) \\\nnet/wireless/Makefile:33:\t\t $(sort $(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR)/*.x509))\nnet/wireless/Makefile-34-\t@$(kecho) \" GEN $@\"\n--\nnet/wireless/chan.c=1694=static bool cfg80211_ir_permissive_chan(struct wiphy *wiphy,\n--\nnet/wireless/chan.c-1702-\nnet/wireless/chan.c:1703:\tif (!IS_ENABLED(CONFIG_CFG80211_REG_RELAX_NO_IR) ||\nnet/wireless/chan.c-1704-\t !(wiphy-\u003eregulatory_flags \u0026 REGULATORY_ENABLE_RELAX_NO_IR))\n--\nnet/wireless/core.c=584=struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,\n--\nnet/wireless/core.c-671-\t\t\t cfg80211_dfs_channels_update_work);\nnet/wireless/core.c:672:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/core.c-673-\trdev-\u003ewiphy.wext = \u0026cfg80211_wext_handler;\n--\nnet/wireless/core.c-693-\nnet/wireless/core.c:694:#ifdef CONFIG_CFG80211_DEFAULT_PS\nnet/wireless/core.c-695-\trdev-\u003ewiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;\n--\nnet/wireless/core.c=1443=static void _cfg80211_unregister_wdev(struct wireless_dev *wdev,\n--\nnet/wireless/core.c-1483-\nnet/wireless/core.c:1484:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/core.c-1485-\tkfree_sensitive(wdev-\u003ewext.keys);\n--\nnet/wireless/core.c=1538=void cfg80211_leave_locked(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/core.c-1562-\nnet/wireless/core.c:1563:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/core.c-1564-\t\tkfree(wdev-\u003ewext.ie);\n--\nnet/wireless/core.c=1649=void cfg80211_init_wdev(struct wireless_dev *wdev)\n--\nnet/wireless/core.c-1657-\nnet/wireless/core.c:1658:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/core.c-1659-\twdev-\u003ewext.default_key = -1;\n--\nnet/wireless/core.c=1742=static int cfg80211_netdev_notifier_call(struct notifier_block *nb,\n--\nnet/wireless/core.c-1816-\t\tswitch (wdev-\u003eiftype) {\nnet/wireless/core.c:1817:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/core.c-1818-\t\tcase NL80211_IFTYPE_ADHOC:\n--\nnet/wireless/core.h=578=cfg80211_get_6ghz_power_type(const u8 *elems, size_t elems_len,\n--\nnet/wireless/core.h-580-\nnet/wireless/core.h:581:#ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS\nnet/wireless/core.h-582-#define CFG80211_DEV_WARN_ON(cond)\tWARN_ON(cond)\n--\nnet/wireless/core.h=628=struct cfg80211_colocated_ap {\n--\nnet/wireless/core.h-644-\nnet/wireless/core.h:645:#if IS_ENABLED(CONFIG_CFG80211_KUNIT_TEST)\nnet/wireless/core.h-646-#define EXPORT_SYMBOL_IF_CFG80211_KUNIT(sym) EXPORT_SYMBOL_IF_KUNIT(sym)\n--\nnet/wireless/core.h=653=size_t cfg80211_gen_new_ie(const u8 *ie, size_t ielen,\n--\nnet/wireless/core.h-658-#define VISIBLE_IF_CFG80211_KUNIT static\nnet/wireless/core.h:659:#endif /* IS_ENABLED(CONFIG_CFG80211_KUNIT_TEST) */\nnet/wireless/core.h-660-\n--\nnet/wireless/debugfs.h-4-\nnet/wireless/debugfs.h:5:#ifdef CONFIG_CFG80211_DEBUGFS\nnet/wireless/debugfs.h-6-void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev);\n--\nnet/wireless/ibss.c=19=void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,\n--\nnet/wireless/ibss.c-23-\tstruct cfg80211_bss *bss;\nnet/wireless/ibss.c:24:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/ibss.c-25-\tunion iwreq_data wrqu;\n--\nnet/wireless/ibss.c-51-\t\t\t\tGFP_KERNEL);\nnet/wireless/ibss.c:52:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/ibss.c-53-\tmemset(\u0026wrqu, 0, sizeof(wrqu));\n--\nnet/wireless/ibss.c=87=int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/ibss.c-140-\nnet/wireless/ibss.c:141:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/ibss.c-142-\twdev-\u003ewext.ibss.chandef = params-\u003echandef;\n--\nnet/wireless/ibss.c=156=void cfg80211_clear_ibss(struct net_device *dev, bool nowext)\n--\nnet/wireless/ibss.c-184-\tmemset(\u0026wdev-\u003eu.ibss.chandef, 0, sizeof(wdev-\u003eu.ibss.chandef));\nnet/wireless/ibss.c:185:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/ibss.c-186-\tif (!nowext)\n--\nnet/wireless/ibss.c=192=int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/ibss.c-213-\nnet/wireless/ibss.c:214:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/ibss.c-215-int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/mlme.c=277=void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,\n--\nnet/wireless/mlme.c-282-\tstruct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);\nnet/wireless/mlme.c:283:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/mlme.c-284-\tunion iwreq_data wrqu;\n--\nnet/wireless/nl80211.c=5467=static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-5509-\nnet/wireless/nl80211.c:5510:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/nl80211.c-5511-\t\twdev-\u003ewext.default_key = key.idx;\n--\nnet/wireless/nl80211.c-5532-\nnet/wireless/nl80211.c:5533:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/nl80211.c-5534-\t\twdev-\u003ewext.default_mgmt_key = key.idx;\n--\nnet/wireless/nl80211.c=5645=static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-5691-\nnet/wireless/nl80211.c:5692:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/nl80211.c-5693-\tif (!err) {\n--\nnet/wireless/nl80211.c=10817=static int nl80211_get_reg_dump(struct sk_buff *skb,\n--\nnet/wireless/nl80211.c-10858-\nnet/wireless/nl80211.c:10859:#ifdef CONFIG_CFG80211_CRDA_SUPPORT\nnet/wireless/nl80211.c-10860-static const struct nla_policy reg_rule_policy[NL80211_REG_RULE_ATTR_MAX + 1] = {\n--\nnet/wireless/nl80211.c=10910=static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-10988-}\nnet/wireless/nl80211.c:10989:#endif /* CONFIG_CFG80211_CRDA_SUPPORT */\nnet/wireless/nl80211.c-10990-\n--\nnet/wireless/nl80211.c=19809=static const struct genl_small_ops nl80211_small_ops[] = {\n--\nnet/wireless/nl80211.c-19982-\t},\nnet/wireless/nl80211.c:19983:#ifdef CONFIG_CFG80211_CRDA_SUPPORT\nnet/wireless/nl80211.c-19984-\t{\n--\nnet/wireless/nl80211.c=23488=void cfg80211_schedule_channels_check(struct wireless_dev *wdev)\n--\nnet/wireless/nl80211.c-23495-\t\t\t\t NL80211_EXT_FEATURE_DFS_CONCURRENT) ||\nnet/wireless/nl80211.c:23496:\t (IS_ENABLED(CONFIG_CFG80211_REG_RELAX_NO_IR) \u0026\u0026\nnet/wireless/nl80211.c-23497-\t wiphy-\u003eregulatory_flags \u0026 REGULATORY_ENABLE_RELAX_NO_IR)))\n--\nnet/wireless/reg.c=497=static int reg_schedule_apply(const struct ieee80211_regdomain *regdom)\n--\nnet/wireless/reg.c-516-\nnet/wireless/reg.c:517:#ifdef CONFIG_CFG80211_CRDA_SUPPORT\nnet/wireless/reg.c-518-/* Max number of consecutive attempts to communicate with CRDA */\n--\nnet/wireless/reg.c=586=static inline int call_crda(const char *alpha2)\n--\nnet/wireless/reg.c-589-}\nnet/wireless/reg.c:590:#endif /* CONFIG_CFG80211_CRDA_SUPPORT */\nnet/wireless/reg.c-591-\n--\nnet/wireless/reg.c=697=static bool valid_country(const u8 *data, unsigned int size,\n--\nnet/wireless/reg.c-729-\nnet/wireless/reg.c:730:#ifdef CONFIG_CFG80211_REQUIRE_SIGNED_REGDB\nnet/wireless/reg.c-731-#include \u003ckeys/asymmetric-type.h\u003e\n--\nnet/wireless/reg.c=735=static int __init load_builtin_regdb_keys(void)\n--\nnet/wireless/reg.c-747-\nnet/wireless/reg.c:748:#ifdef CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS\nnet/wireless/reg.c-749-\tx509_load_certificate_list(shipped_regdb_certs,\n--\nnet/wireless/reg.c-752-#endif\nnet/wireless/reg.c:753:#ifdef CONFIG_CFG80211_EXTRA_REGDB_KEYDIR\nnet/wireless/reg.c:754:\tif (CONFIG_CFG80211_EXTRA_REGDB_KEYDIR[0] != '\\0')\nnet/wireless/reg.c-755-\t\tx509_load_certificate_list(extra_regdb_certs,\n--\nnet/wireless/reg.c=798=static void free_regdb_keyring(void)\n--\nnet/wireless/reg.c-800-}\nnet/wireless/reg.c:801:#endif /* CONFIG_CFG80211_REQUIRE_SIGNED_REGDB */\nnet/wireless/reg.c-802-\n--\nnet/wireless/reg.c=2038=bool reg_last_request_cell_base(void)\n--\nnet/wireless/reg.c-2042-\nnet/wireless/reg.c:2043:#ifdef CONFIG_CFG80211_REG_CELLULAR_HINTS\nnet/wireless/reg.c-2044-/* Core specific check */\n--\nnet/wireless/scan.c=1117=void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/scan.c-1122-\tstruct sk_buff *msg;\nnet/wireless/scan.c:1123:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/scan.c-1124-\tunion iwreq_data wrqu;\n--\nnet/wireless/scan.c-1165-\nnet/wireless/scan.c:1166:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/scan.c-1167-\tif (wdev-\u003enetdev \u0026\u0026 !request-\u003einfo.aborted) {\n--\nnet/wireless/scan.c=3443=void cfg80211_update_assoc_bss_entry(struct wireless_dev *wdev,\n--\nnet/wireless/scan.c-3516-\nnet/wireless/scan.c:3517:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/scan.c-3518-static struct cfg80211_registered_device *\n--\nnet/wireless/sme.c=735=void __cfg80211_connect_result(struct net_device *dev,\n--\nnet/wireless/sme.c-743-\tu8 country_datalen;\nnet/wireless/sme.c:744:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/sme.c-745-\tunion iwreq_data wrqu;\n--\nnet/wireless/sme.c-774-\nnet/wireless/sme.c:775:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/sme.c-776-\tif (wextev \u0026\u0026 !cr-\u003evalid_links) {\n--\nnet/wireless/sme.c=1079=void __cfg80211_roamed(struct wireless_dev *wdev,\n--\nnet/wireless/sme.c-1081-{\nnet/wireless/sme.c:1082:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/sme.c-1083-\tunion iwreq_data wrqu;\n--\nnet/wireless/sme.c-1134-\nnet/wireless/sme.c:1135:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/sme.c-1136-\tif (!info-\u003evalid_links) {\n--\nnet/wireless/sme.c=1343=void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,\n--\nnet/wireless/sme.c-1348-\tint i;\nnet/wireless/sme.c:1349:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/sme.c-1350-\tunion iwreq_data wrqu;\n--\nnet/wireless/sme.c-1394-\nnet/wireless/sme.c:1395:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/sme.c-1396-\tmemset(\u0026wrqu, 0, sizeof(wrqu));\n--\nnet/wireless/tests/Makefile=1=cfg80211-tests-y += module.o fragmentation.o scan.o util.o chan.o\nnet/wireless/tests/Makefile-2-\nnet/wireless/tests/Makefile:3:obj-$(CONFIG_CFG80211_KUNIT_TEST) += cfg80211-tests.o\n--\nnet/wireless/wext-core.c=637=EXPORT_SYMBOL(wireless_send_event);\nnet/wireless/wext-core.c-638-\nnet/wireless/wext-core.c:639:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/wext-core.c-640-static void wireless_warn_cfg80211_wext(void)\n--\nnet/wireless/wext-core.c=649=struct iw_statistics *get_wireless_stats(struct net_device *dev)\n--\nnet/wireless/wext-core.c-656-\nnet/wireless/wext-core.c:657:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/wext-core.c-658-\tif (dev-\u003eieee80211_ptr \u0026\u0026\n--\nnet/wireless/wext-core.c=696=static iw_handler get_handler(struct net_device *dev, unsigned int cmd)\n--\nnet/wireless/wext-core.c-701-\nnet/wireless/wext-core.c:702:#ifdef CONFIG_CFG80211_WEXT\nnet/wireless/wext-core.c-703-\tif (dev-\u003eieee80211_ptr \u0026\u0026 dev-\u003eieee80211_ptr-\u003ewiphy) {\n--\nnet/wireless/wext-proc.c=28=static void wireless_seq_printf_stats(struct seq_file *seq,\n--\nnet/wireless/wext-proc.c-40-#endif\nnet/wireless/wext-proc.c:41:#ifdef CONFIG_CFG80211\nnet/wireless/wext-proc.c-42-\t\tif (dev-\u003eieee80211_ptr)\n"
} |
| 5/2 | 2026/09/07 22:18 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 15925 output: 39 thoughts: 22 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Kconfig Dive for MAC80211 and CFG80211** Okay, time to dig into the Kconfig files. My gut tells me something feels off with the MAC80211 and CFG80211 setup, and the Kconfig files are the best place to start. I need to refresh my understanding of how those features are configured, which options are available, and most importantly, any recent changes or dependencies that might be relevant. I want to quickly identify the relevant symbols, their default values, and any relationships they have with other parts of the wireless subsystem or even the kernel as a whole. I'm looking for anything unusual or anything that might lead to a configuration issue down the line. It's time to refresh my understanding to make sure nothing has changed recently. |
| 6/2 | 2026/09/07 22:18 | tool | grepper |
0mArgs:{
"Expression": "config CFG80211|config MAC80211",
"PathPrefix": "net/wireless"
}Results: {
"Output": "net/wireless/Kconfig=14=config WEXT_PRIV\n--\nnet/wireless/Kconfig-16-\nnet/wireless/Kconfig:17:config CFG80211\nnet/wireless/Kconfig-18-\ttristate \"cfg80211 - wireless configuration API\"\n--\nnet/wireless/Kconfig=38=config NL80211_TESTMODE\n--\nnet/wireless/Kconfig-51-\nnet/wireless/Kconfig:52:config CFG80211_DEVELOPER_WARNINGS\nnet/wireless/Kconfig-53-\tbool \"enable developer warnings\"\n--\nnet/wireless/Kconfig-67-\nnet/wireless/Kconfig:68:config CFG80211_CERTIFICATION_ONUS\nnet/wireless/Kconfig-69-\tbool \"cfg80211 certification onus\"\n--\nnet/wireless/Kconfig-88-\nnet/wireless/Kconfig:89:config CFG80211_REQUIRE_SIGNED_REGDB\nnet/wireless/Kconfig-90-\tbool \"require regdb signature\" if CFG80211_CERTIFICATION_ONUS\n--\nnet/wireless/Kconfig-98-\nnet/wireless/Kconfig:99:config CFG80211_USE_KERNEL_REGDB_KEYS\nnet/wireless/Kconfig-100-\tbool \"allow regdb keys shipped with the kernel\" if CFG80211_CERTIFICATION_ONUS\n--\nnet/wireless/Kconfig-110-\nnet/wireless/Kconfig:111:config CFG80211_EXTRA_REGDB_KEYDIR\nnet/wireless/Kconfig-112-\tstring \"additional regdb key directory\" if CFG80211_CERTIFICATION_ONUS\n--\nnet/wireless/Kconfig-121-\nnet/wireless/Kconfig:122:config CFG80211_REG_CELLULAR_HINTS\nnet/wireless/Kconfig-123-\tbool \"cfg80211 regulatory support for cellular base station hints\"\n--\nnet/wireless/Kconfig-134-\nnet/wireless/Kconfig:135:config CFG80211_REG_RELAX_NO_IR\nnet/wireless/Kconfig-136-\tbool \"cfg80211 support for NO_IR relaxation\"\n--\nnet/wireless/Kconfig-158-\nnet/wireless/Kconfig:159:config CFG80211_DEFAULT_PS\nnet/wireless/Kconfig-160-\tbool \"enable powersave by default\"\n--\nnet/wireless/Kconfig-168-\nnet/wireless/Kconfig:169:config CFG80211_DEBUGFS\nnet/wireless/Kconfig-170-\tbool \"cfg80211 DebugFS entries\"\n--\nnet/wireless/Kconfig-176-\nnet/wireless/Kconfig:177:config CFG80211_CRDA_SUPPORT\nnet/wireless/Kconfig-178-\tbool \"support CRDA\" if EXPERT\n--\nnet/wireless/Kconfig-186-\nnet/wireless/Kconfig:187:config CFG80211_WEXT\nnet/wireless/Kconfig-188-\tbool \"cfg80211 wireless extensions compatibility\"\n--\nnet/wireless/Kconfig-193-\nnet/wireless/Kconfig:194:config CFG80211_KUNIT_TEST\nnet/wireless/Kconfig-195-\ttristate \"KUnit tests for cfg80211\" if !KUNIT_ALL_TESTS\n"
} |
| 7/2 | 2026/09/07 22:18 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 17092 output: 35 thoughts: 17 Thoughts: Here's a summary of my thought process, as if I were the one thinking it: **Diving into the 802.11 Kconfig** Alright, time to get to the heart of the matter. Let's start with a deep dive into `net/mac80211/Kconfig`. This is where the core configuration options for the mac80211 subsystem live, so it's the natural place to start any investigation or modification related to its configuration. I'll be looking for relevant variables, dependencies, and defaults that might inform the next steps. It's time to sift through the options. |
| 8/2 | 2026/09/07 22:18 | tool | grepper |
0mArgs:{
"Expression": "config MAC80211",
"PathPrefix": "net/mac80211"
}Results: {
"Output": "net/mac80211/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\nnet/mac80211/Kconfig:2:config MAC80211\nnet/mac80211/Kconfig-3-\ttristate \"Generic IEEE 802.11 Networking Stack (mac80211)\"\n--\nnet/mac80211/Kconfig=19=if MAC80211 != n\nnet/mac80211/Kconfig-20-\nnet/mac80211/Kconfig:21:config MAC80211_HAS_RC\nnet/mac80211/Kconfig-22-\tbool\nnet/mac80211/Kconfig-23-\nnet/mac80211/Kconfig:24:config MAC80211_RC_MINSTREL\nnet/mac80211/Kconfig-25-\tbool \"Minstrel\" if EXPERT\n--\nnet/mac80211/Kconfig=31=choice\n--\nnet/mac80211/Kconfig-40-\nnet/mac80211/Kconfig:41:config MAC80211_RC_DEFAULT_MINSTREL\nnet/mac80211/Kconfig-42-\tbool \"Minstrel\"\n--\nnet/mac80211/Kconfig=48=endchoice\nnet/mac80211/Kconfig-49-\nnet/mac80211/Kconfig:50:config MAC80211_RC_DEFAULT\nnet/mac80211/Kconfig-51-\tstring\n--\nnet/mac80211/Kconfig=57=comment \"Some wireless drivers require a rate control algorithm\"\n--\nnet/mac80211/Kconfig-59-\nnet/mac80211/Kconfig:60:config MAC80211_KUNIT_TEST\nnet/mac80211/Kconfig-61-\ttristate \"KUnit tests for mac80211\" if !KUNIT_ALL_TESTS\n--\nnet/mac80211/Kconfig-69-\nnet/mac80211/Kconfig:70:config MAC80211_MESH\nnet/mac80211/Kconfig-71-\tbool \"Enable mac80211 mesh networking support\"\n--\nnet/mac80211/Kconfig-78-\nnet/mac80211/Kconfig:79:config MAC80211_LEDS\nnet/mac80211/Kconfig-80-\tbool \"Enable LED triggers\"\n--\nnet/mac80211/Kconfig-87-\nnet/mac80211/Kconfig:88:config MAC80211_DEBUGFS\nnet/mac80211/Kconfig-89-\tbool \"Export mac80211 internals in DebugFS\"\n--\nnet/mac80211/Kconfig-96-\nnet/mac80211/Kconfig:97:config MAC80211_MESSAGE_TRACING\nnet/mac80211/Kconfig-98-\tbool \"Trace all mac80211 debug messages\"\n--\nnet/mac80211/Kconfig-109-\nnet/mac80211/Kconfig:110:menuconfig MAC80211_DEBUG_MENU\nnet/mac80211/Kconfig-111-\tbool \"Select mac80211 debugging features\"\n--\nnet/mac80211/Kconfig-115-\nnet/mac80211/Kconfig:116:config MAC80211_NOINLINE\nnet/mac80211/Kconfig-117-\tbool \"Do not inline TX/RX handlers\"\n--\nnet/mac80211/Kconfig-131-\nnet/mac80211/Kconfig:132:config MAC80211_VERBOSE_DEBUG\nnet/mac80211/Kconfig-133-\tbool \"Verbose debugging output\"\n--\nnet/mac80211/Kconfig-142-\nnet/mac80211/Kconfig:143:config MAC80211_MLME_DEBUG\nnet/mac80211/Kconfig-144-\tbool \"Verbose managed MLME output\"\n--\nnet/mac80211/Kconfig-153-\nnet/mac80211/Kconfig:154:config MAC80211_STA_DEBUG\nnet/mac80211/Kconfig-155-\tbool \"Verbose station debugging\"\n--\nnet/mac80211/Kconfig-162-\nnet/mac80211/Kconfig:163:config MAC80211_HT_DEBUG\nnet/mac80211/Kconfig-164-\tbool \"Verbose HT debugging\"\n--\nnet/mac80211/Kconfig-174-\nnet/mac80211/Kconfig:175:config MAC80211_OCB_DEBUG\nnet/mac80211/Kconfig-176-\tbool \"Verbose OCB debugging\"\n--\nnet/mac80211/Kconfig-185-\nnet/mac80211/Kconfig:186:config MAC80211_IBSS_DEBUG\nnet/mac80211/Kconfig-187-\tbool \"Verbose IBSS debugging\"\n--\nnet/mac80211/Kconfig-196-\nnet/mac80211/Kconfig:197:config MAC80211_PS_DEBUG\nnet/mac80211/Kconfig-198-\tbool \"Verbose powersave mode debugging\"\n--\nnet/mac80211/Kconfig-208-\nnet/mac80211/Kconfig:209:config MAC80211_MPL_DEBUG\nnet/mac80211/Kconfig-210-\tbool \"Verbose mesh peer link debugging\"\n--\nnet/mac80211/Kconfig-221-\nnet/mac80211/Kconfig:222:config MAC80211_MPATH_DEBUG\nnet/mac80211/Kconfig-223-\tbool \"Verbose mesh path debugging\"\n--\nnet/mac80211/Kconfig-234-\nnet/mac80211/Kconfig:235:config MAC80211_MHWMP_DEBUG\nnet/mac80211/Kconfig-236-\tbool \"Verbose mesh HWMP routing debugging\"\n--\nnet/mac80211/Kconfig-247-\nnet/mac80211/Kconfig:248:config MAC80211_MESH_SYNC_DEBUG\nnet/mac80211/Kconfig-249-\tbool \"Verbose mesh synchronization debugging\"\n--\nnet/mac80211/Kconfig-258-\nnet/mac80211/Kconfig:259:config MAC80211_MESH_CSA_DEBUG\nnet/mac80211/Kconfig-260-\tbool \"Verbose mesh channel switch debugging\"\n--\nnet/mac80211/Kconfig-269-\nnet/mac80211/Kconfig:270:config MAC80211_MESH_PS_DEBUG\nnet/mac80211/Kconfig-271-\tbool \"Verbose mesh powersave debugging\"\n--\nnet/mac80211/Kconfig-280-\nnet/mac80211/Kconfig:281:config MAC80211_TDLS_DEBUG\nnet/mac80211/Kconfig-282-\tbool \"Verbose TDLS debugging\"\n--\nnet/mac80211/Kconfig-292-\nnet/mac80211/Kconfig:293:config MAC80211_DEBUG_COUNTERS\nnet/mac80211/Kconfig-294-\tbool \"Extra statistics for TX/RX debugging\"\n--\nnet/mac80211/Kconfig-307-\nnet/mac80211/Kconfig:308:config MAC80211_STA_HASH_MAX_SIZE\nnet/mac80211/Kconfig-309-\tint \"Station hash table maximum size\" if MAC80211_DEBUG_MENU\n"
} |
| 9/2 | 2026/09/07 22:18 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 19462 output: 38 thoughts: 131 Thoughts: **My Initial Thoughts on mac80211_hwsim and NAN** Okay, let's dive into this. I need to understand the interaction between `mac80211_hwsim` and NAN, specifically focusing on whether it's correctly handling these features. The first thing that comes to mind is the configuration interface. I know `mac80211_hwsim` relies on `mac80211_config_ops`, and I need to see how that's being used in this context. Specifically, I need to check how the `.nan_set_non_evac_channels` function pointer, which links to `ieee80211_set_nan_non_evac_channels`, is being handled. Is it being set correctly? Is it being called at the appropriate times? I’ll need to trace the code to see if the NAN non-evacuation channels are properly configured. I should probably start by examining the Kconfig options for `mac80211_hwsim` to see how it's integrated and how `mac80211` uses the `mac80211_config_ops` in general. Is `hwsim` or `cfg80211` enabled in the kernel builds? This is something I should also bear in mind. |
| 10/2 | 2026/09/07 22:18 | tool | grepper |
0mArgs:{
"Expression": "mac80211_config_ops",
"PathPrefix": "net/mac80211"
}Results: {
"Output": "net/mac80211/cfg.c=5977=ieee80211_set_nan_non_evac_channels(struct wiphy *wiphy,\n--\nnet/mac80211/cfg.c-5987-\nnet/mac80211/cfg.c:5988:const struct cfg80211_ops mac80211_config_ops = {\nnet/mac80211/cfg.c-5989-\t.add_virtual_intf = ieee80211_add_iface,\n--\nnet/mac80211/ieee80211_i.h-38-\nnet/mac80211/ieee80211_i.h:39:extern const struct cfg80211_ops mac80211_config_ops;\nnet/mac80211/ieee80211_i.h-40-\n--\nnet/mac80211/main.c=793=struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,\n--\nnet/mac80211/main.c-852-\nnet/mac80211/main.c:853:\twiphy = wiphy_new_nm(\u0026mac80211_config_ops, priv_size, requested_name);\nnet/mac80211/main.c-854-\n"
} |
| 11/2 | 2026/09/07 22:18 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 20318 output: 36 thoughts: 56 Thoughts: Here's my thinking: **Examining the mac80211 Configuration** Okay, so `mac80211_config_ops`... that's the shared operational structure used across *all* the mac80211 drivers. That means it's fundamental. And I know `mac80211_hwsim` leverages it too, naturally. Now, what's going on with the underlying configuration? The next logical step is to dive into the Kconfig options. Let's get that `CONFIG_MAC80211_HWSIM` setting and see what's what. I need to understand what's controlling the inclusion and behavior of the hardware simulator. |
| 12/2 | 2026/09/07 22:18 | tool | grepper |
0mArgs:{
"Expression": "config MAC80211_HWSIM",
"PathPrefix": "drivers/net/wireless"
}Results: {
"Output": "drivers/net/wireless/virtual/Kconfig:1:config MAC80211_HWSIM\ndrivers/net/wireless/virtual/Kconfig-2-\ttristate \"Simulated radio testing tool for mac80211\"\n"
} |
| 13/2 | 2026/09/07 22:18 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 20634 output: 36 thoughts: 16 Thoughts: Here's my take on the thought process, as if I were the one thinking it: **Diving into Virtual Wireless Configuration** Okay, time to get my hands dirty. I need to understand the configuration options available for the virtual wireless network driver. My first instinct, as always, is to head straight to the source. Specifically, I need to check the Kconfig file for that driver. Let's start with `drivers/net/wireless/virtual/Kconfig`. This is where all the juicy details about feature flags, dependencies, and default settings are kept. That's the first stop to understand how this module fits into the broader wireless landscape and what's configurable. Let's see what we can find. |
| 14/2 | 2026/09/07 22:18 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/virtual/Kconfig",
"FirstLine": 1,
"LineCount": 40
}Results: {
"Contents": " 1:\tconfig MAC80211_HWSIM\n 2:\t\ttristate \"Simulated radio testing tool for mac80211\"\n 3:\t\tdepends on MAC80211\n 4:\t\thelp\n 5:\t\t This driver is a developer testing tool that can be used to test\n 6:\t\t IEEE 802.11 networking stack (mac80211) functionality. This is not\n 7:\t\t needed for normal wireless LAN usage and is only for testing. See\n 8:\t\t Documentation/networking/mac80211_hwsim for more information on how\n 9:\t\t to use this tool.\n 10:\t\n 11:\t\t To compile this driver as a module, choose M here: the module will be\n 12:\t\t called mac80211_hwsim. If unsure, say N.\n 13:\t\n 14:\tconfig VIRT_WIFI\n 15:\t\ttristate \"Wifi wrapper for ethernet drivers\"\n 16:\t\tdepends on CFG80211\n 17:\t\thelp\n 18:\t\t This option adds support for ethernet connections to appear as if they\n 19:\t\t are wifi connections through a special rtnetlink device.\n 20:\t\n"
} |
| 15/2 | 2026/09/07 22:18 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 21162 output: 42 thoughts: 129 Thoughts: **Diving into the NAN Implementation** Okay, let's get down to brass tacks. I need to fully grasp the implementation of NAN, specifically the evacuation channel logic. To do that, I'm going to dig into the `mac80211` code base. My first step is a code review of `nl80211.c`, `core.c`, and `nan.c`. I want to see how these files interact and where the core functions are defined. Specifically, I need to understand how the non-evacuation channels are managed. I'll focus on the functions `nl80211_nan_set_non_evac_channels`, `cfg80211_nan_set_non_evac_channels`, and `ieee80211_nan_set_non_evac_channels` and how they tie into the broader architecture. I'll start with `nl80211.c`, and I'm targeting around line 17763 as a starting point. I suspect that's where the relevant entry points will be defined. I'll need to trace the call paths from there. |
| 16/2 | 2026/09/07 22:19 | tool | read-file |
0mArgs:{
"File": "net/wireless/nl80211.c",
"FirstLine": 17760,
"LineCount": 80
}Results: {
"Contents": "17760:\t\t\t\tnla_len(info-\u003eattrs[NL80211_ATTR_NAN_AVAIL_BLOB]);\n17761:\t\t}\n17762:\t\n17763:\t\treturn cfg80211_nan_set_local_schedule(rdev, wdev, sched);\n17764:\t}\n17765:\t\n17766:\tstatic int\n17767:\tnl80211_parse_non_evac_channel(struct cfg80211_registered_device *rdev,\n17768:\t\t\t\t struct nlattr *channel, struct genl_info *info,\n17769:\t\t\t\t struct cfg80211_chan_def *chandef)\n17770:\t{\n17771:\t\tstruct nlattr **channel_parsed __free(kfree) =\n17772:\t\t\tkcalloc(NL80211_ATTR_MAX + 1, sizeof(*channel_parsed),\n17773:\t\t\t\tGFP_KERNEL);\n17774:\t\tint ret;\n17775:\t\n17776:\t\tif (!channel_parsed)\n17777:\t\t\treturn -ENOMEM;\n17778:\t\n17779:\t\tret = nla_parse_nested(channel_parsed, NL80211_ATTR_MAX, channel, NULL,\n17780:\t\t\t\t info-\u003eextack);\n17781:\t\tif (ret)\n17782:\t\t\treturn ret;\n17783:\t\n17784:\t\treturn nl80211_parse_chandef(rdev, info-\u003eextack, channel_parsed,\n17785:\t\t\t\t\t chandef, false);\n17786:\t}\n17787:\t\n17788:\tstatic int nl80211_nan_set_non_evac_channels(struct sk_buff *skb,\n17789:\t\t\t\t\t\t struct genl_info *info)\n17790:\t{\n17791:\t\tstruct cfg80211_registered_device *rdev = info-\u003euser_ptr[0];\n17792:\t\tstruct wireless_dev *wdev = info-\u003euser_ptr[1];\n17793:\t\tint rem, i = 0, n_channels = 0;\n17794:\t\tstruct nlattr *channel;\n17795:\t\n17796:\t\tif (wdev-\u003eiftype != NL80211_IFTYPE_NAN)\n17797:\t\t\treturn -EOPNOTSUPP;\n17798:\t\n17799:\t\tif (!wdev_running(wdev))\n17800:\t\t\treturn -ENOTCONN;\n17801:\t\n17802:\t\t/* Count how many channel attributes we got */\n17803:\t\tnlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,\n17804:\t\t\t\t\t info-\u003enlhdr, GENL_HDRLEN, rem)\n17805:\t\t\tn_channels++;\n17806:\t\n17807:\t\tstruct cfg80211_nan_non_evac_channels *channels __free(kfree) =\n17808:\t\t\tkzalloc(struct_size(channels, chandefs, n_channels),\n17809:\t\t\t\tGFP_KERNEL);\n17810:\t\tif (!channels)\n17811:\t\t\treturn -ENOMEM;\n17812:\t\n17813:\t\tchannels-\u003en_channels = n_channels;\n17814:\t\n17815:\t\tnlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,\n17816:\t\t\t\t\t info-\u003enlhdr, GENL_HDRLEN, rem) {\n17817:\t\t\tint ret;\n17818:\t\n17819:\t\t\tret = nl80211_parse_non_evac_channel(rdev, channel, info,\n17820:\t\t\t\t\t\t\t \u0026channels-\u003echandefs[i]);\n17821:\t\t\tif (ret)\n17822:\t\t\t\treturn ret;\n17823:\t\t\ti++;\n17824:\t\t}\n17825:\t\n17826:\t\treturn cfg80211_nan_set_non_evac_channels(rdev, wdev, channels);\n17827:\t}\n17828:\t\n17829:\tstatic int nl80211_get_protocol_features(struct sk_buff *skb,\n17830:\t\t\t\t\t\t struct genl_info *info)\n17831:\t{\n17832:\t\tvoid *hdr;\n17833:\t\tstruct sk_buff *msg;\n17834:\t\n17835:\t\tmsg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);\n17836:\t\tif (!msg)\n17837:\t\t\treturn -ENOMEM;\n17838:\t\n17839:\t\thdr = nl80211hdr_put(msg, info-\u003esnd_portid, info-\u003esnd_seq, 0,\n"
} |
| 17/2 | 2026/09/07 22:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 22968 output: 35 thoughts: 24 Thoughts: Here's a first-person summary, tailored for an expert audience, as requested: **Digging into Wireless Core Functionality** Okay, time to get my hands dirty. I'm going to zero in on `net/wireless/core.c`, specifically around lines 320 to 370. That section likely deals with some critical, foundational aspects of the wireless core – probably the initialization, registration, or handling of some core wireless structures. I need to refresh my memory on the interactions of those components. I'm expecting to find either the core of some fundamental data structures or the entry points for the most basic wireless functions. It could be related to regulatory handling or hardware abstraction, or even some aspects of net device integration. Let's see if this is something basic, like a mutex init, or if this is where the interesting bit is. |
| 18/2 | 2026/09/07 22:19 | tool | read-file |
0mArgs:{
"File": "net/wireless/core.c",
"FirstLine": 320,
"LineCount": 50
}Results: {
"Contents": " 320:\t\tfor (int i = 0; i \u003c sched-\u003en_channels; i++)\n 321:\t\t\twdev-\u003eu.nan.chandefs[i] = sched-\u003enan_channels[i].chandef;\n 322:\t\n 323:\t\twdev-\u003eu.nan.n_channels = sched-\u003en_channels;\n 324:\t\n 325:\t\treturn 0;\n 326:\t}\n 327:\t\n 328:\tint cfg80211_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,\n 329:\t\t\t\t\t struct wireless_dev *wdev,\n 330:\t\t\t\t\t struct cfg80211_nan_non_evac_channels *channels)\n 331:\t{\n 332:\t\tlockdep_assert_held(\u0026rdev-\u003ewiphy.mtx);\n 333:\t\n 334:\t\tif (wdev-\u003eiftype != NL80211_IFTYPE_NAN || !wdev_running(wdev))\n 335:\t\t\treturn -EINVAL;\n 336:\t\n 337:\t\t/*\n 338:\t\t * Don't allow updating the non-evacuable channels while a deferred\n 339:\t\t * schedule update is pending, as the set of channels may still change.\n 340:\t\t */\n 341:\t\tif (wdev-\u003eu.nan.sched_update_pending)\n 342:\t\t\treturn -EBUSY;\n 343:\t\n 344:\t\t/* All provided channels must belong to the current local schedule. */\n 345:\t\tfor (int i = 0; i \u003c channels-\u003en_channels; i++) {\n 346:\t\t\tbool found = false;\n 347:\t\n 348:\t\t\tfor (int j = 0; j \u003c wdev-\u003eu.nan.n_channels; j++) {\n 349:\t\t\t\tif (cfg80211_chandef_identical(\u0026wdev-\u003eu.nan.chandefs[j],\n 350:\t\t\t\t\t\t\t \u0026channels-\u003echandefs[i])) {\n 351:\t\t\t\t\tfound = true;\n 352:\t\t\t\t\tbreak;\n 353:\t\t\t\t}\n 354:\t\t\t}\n 355:\t\n 356:\t\t\tif (!found)\n 357:\t\t\t\treturn -ENOENT;\n 358:\t\t}\n 359:\t\n 360:\t\treturn rdev_nan_set_non_evac_channels(rdev, wdev, channels);\n 361:\t}\n 362:\t\n 363:\tvoid cfg80211_stop_pd(struct cfg80211_registered_device *rdev,\n 364:\t\t\t struct wireless_dev *wdev)\n 365:\t{\n 366:\t\tlockdep_assert_held(\u0026rdev-\u003ewiphy.mtx);\n 367:\t\n 368:\t\tif (WARN_ON(wdev-\u003eiftype != NL80211_IFTYPE_PD))\n 369:\t\t\treturn;\n"
} |
| 19/2 | 2026/09/07 22:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 24024 output: 40 thoughts: 18 Thoughts: Here's my take on the thought process, as if it were my own: **Diving into the NAN Code** Okay, time to dig in. I need to get a handle on the NAN implementation. The best place to start, given the task at hand, is undoubtedly `net/mac80211/nan.c`. That's where all the core functionality related to Neighbor Awareness Networking (NAN) should be. I'll need to refresh my memory on the data structures and control flow. Let's see what we've got in there. |
| 20/2 | 2026/09/07 22:19 | tool | read-file |
0mArgs:{
"File": "net/mac80211/nan.c",
"FirstLine": 240,
"LineCount": 50
}Results: {
"Contents": " 240:\tstatic struct ieee80211_nan_channel *\n 241:\tieee80211_nan_find_free_channel(struct ieee80211_nan_sched_cfg *sched_cfg)\n 242:\t{\n 243:\t\tfor (int i = 0; i \u003c ARRAY_SIZE(sched_cfg-\u003echannels); i++) {\n 244:\t\t\tif (!sched_cfg-\u003echannels[i].chanreq.oper.chan)\n 245:\t\t\t\treturn \u0026sched_cfg-\u003echannels[i];\n 246:\t\t}\n 247:\t\n 248:\t\treturn NULL;\n 249:\t}\n 250:\t\n 251:\tint\n 252:\tieee80211_nan_set_non_evac_channels(struct ieee80211_sub_if_data *sdata,\n 253:\t\t\t\t\t struct cfg80211_nan_non_evac_channels *channels)\n 254:\t{\n 255:\t\tstruct ieee80211_nan_sched_cfg *sched_cfg = \u0026sdata-\u003evif.cfg.nan_sched;\n 256:\t\n 257:\t\t/*\n 258:\t\t * cfg80211 already validated that all provided channels belong to the\n 259:\t\t * current schedule, so just clear all non-evacuable flags and set the\n 260:\t\t * ones in the list.\n 261:\t\t */\n 262:\t\tfor (int j = 0; j \u003c ARRAY_SIZE(sched_cfg-\u003echannels); j++)\n 263:\t\t\tsched_cfg-\u003echannels[j].no_evacuate = false;\n 264:\t\n 265:\t\tfor (int i = 0; i \u003c channels-\u003en_channels; i++) {\n 266:\t\t\tfor (int j = 0; j \u003c ARRAY_SIZE(sched_cfg-\u003echannels); j++) {\n 267:\t\t\t\tif (!sched_cfg-\u003echannels[j].chanreq.oper.chan)\n 268:\t\t\t\t\tcontinue;\n 269:\t\t\t\tif (cfg80211_chandef_identical(\u0026sched_cfg-\u003echannels[j].chanreq.oper,\n 270:\t\t\t\t\t\t\t \u0026channels-\u003echandefs[i])) {\n 271:\t\t\t\t\tsched_cfg-\u003echannels[j].no_evacuate = true;\n 272:\t\t\t\t\tbreak;\n 273:\t\t\t\t}\n 274:\t\t\t}\n 275:\t\t}\n 276:\t\n 277:\t\treturn 0;\n 278:\t}\n 279:\t\n 280:\tint ieee80211_nan_set_local_sched(struct ieee80211_sub_if_data *sdata,\n 281:\t\t\t\t\t struct cfg80211_nan_local_sched *sched)\n 282:\t{\n 283:\t\tstruct ieee80211_nan_channel *sched_idx_to_chan[IEEE80211_NAN_MAX_CHANNELS] = {};\n 284:\t\tstruct ieee80211_nan_sched_cfg *sched_cfg = \u0026sdata-\u003evif.cfg.nan_sched;\n 285:\t\tstruct ieee80211_nan_sched_cfg *backup_sched __free(kfree) = kmalloc_obj(*backup_sched);\n 286:\t\tint ret;\n 287:\t\n 288:\t\tif (!backup_sched)\n 289:\t\t\treturn -ENOMEM;\n"
} |
| 21/2 | 2026/09/07 22:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 25138 output: 40 thoughts: 37 Thoughts: Here's a summary of my thought process, as requested: **Diving into the NAN Evacuation Channel Search** Okay, time to dig into the NAN code again. I need to refresh my understanding of how we handle channel evacuation in the 802.11 NAN system. Specifically, I'm going to head directly to the `ieee80211_nan_find_evac_chan` function, which I believe is in `net/mac80211/nan.c`. That should be the core of where the channel selection logic for evacuation resides. I'm hoping I can either identify the exact algorithm in use, or determine the inputs it leverages. My guess is it's handling a lot of the channel-hopping and potentially dynamic configuration that's involved, and it will be interesting to see how sophisticated the selection is. I'm anticipating some considerations for interference mitigation, throughput optimization, and perhaps even power management in this function. Let's see what's actually under the hood. |
| 22/2 | 2026/09/07 22:19 | tool | read-file |
0mArgs:{
"File": "net/mac80211/nan.c",
"FirstLine": 800,
"LineCount": 40
}Results: {
"Contents": " 800:\t\n 801:\t\tif (WARN_ON(sdata-\u003evif.type != NL80211_IFTYPE_NAN))\n 802:\t\t\treturn NULL;\n 803:\t\n 804:\t\tsched_cfg = \u0026sdata-\u003evif.cfg.nan_sched;\n 805:\t\n 806:\t\t/* Find the channel to evacuate and count usable channels */\n 807:\t\tfor (int i = 0; i \u003c IEEE80211_NAN_MAX_CHANNELS; i++) {\n 808:\t\t\tstruct ieee80211_nan_channel *chan =\n 809:\t\t\t\t\u0026sched_cfg-\u003echannels[i];\n 810:\t\t\tstruct ieee80211_chanctx *chan_ctx;\n 811:\t\t\tint slot_count = 0;\n 812:\t\n 813:\t\t\tif (!chan-\u003echanreq.oper.chan || !chan-\u003echanctx_conf)\n 814:\t\t\t\tcontinue;\n 815:\t\n 816:\t\t\tusable_channels++;\n 817:\t\n 818:\t\t\t/* No-evacuate channel is usable but cannot be evacuated */\n 819:\t\t\tif (chan-\u003eno_evacuate)\n 820:\t\t\t\tcontinue;\n 821:\t\n 822:\t\t\tchan_ctx = container_of(chan-\u003echanctx_conf,\n 823:\t\t\t\t\t\tstruct ieee80211_chanctx, conf);\n 824:\t\n 825:\t\t\t/* If ctx specified, only consider that specific chanctx */\n 826:\t\t\tif (ctx) {\n 827:\t\t\t\tif (chan_ctx == ctx)\n 828:\t\t\t\t\tevac_chan = chan;\n 829:\t\t\t\tcontinue;\n 830:\t\t\t}\n 831:\t\n 832:\t\t\t/* Can only evacuate channels whose chanctx is NAN-only */\n 833:\t\t\tif (ieee80211_chanctx_refcount(local, chan_ctx) \u003e 1)\n 834:\t\t\t\tcontinue;\n 835:\t\n 836:\t\t\t/* Count how many time slots use this channel */\n 837:\t\t\tfor (int s = 0; s \u003c CFG80211_NAN_SCHED_NUM_TIME_SLOTS; s++)\n 838:\t\t\t\tif (sched_cfg-\u003eschedule[s] == chan)\n 839:\t\t\t\t\tslot_count++;\n"
} |
| 23/2 | 2026/09/07 22:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 26074 output: 27 thoughts: 270 Thoughts: **My Fuzzing Radar is Blinking!** Okay, this looks *very* promising for fuzzing. `WorthFuzzing=true` is practically screaming for it. Specifically, the introduction of this new `NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS` netlink command handler, `nl80211_nan_set_non_evac_channels`, is exactly the kind of target I'm looking for. What catches my eye immediately are these critical factors: * **Userspace Interface:** It's accessible directly from userspace via netlink, which simplifies the fuzzing setup significantly. No complex device drivers to deal with initially. * **Dynamic Allocations and Parsing:** Nested netlink attributes with dynamic allocations? Perfect! This is a classic recipe for memory corruption bugs. The parsing logic is ripe for malformed input exploitation. * **Widespread Impact:** It touches several key functions (`cfg80211_nan_set_non_evac_channels`, `ieee80211_nan_set_non_evac_channels`, and evacuation logic in `ieee80211_nan_find_evac_chan`), which broadens the scope for vulnerabilities to be found. * **Virtualization Friendly:** Fully reachable through netlink in virtualized environments (nl80211 and mac80211 / mac80211\_hwsim). This means I can run this with ease in an automated fuzzer. This will make testing easier. Now, before I dive in, let's make sure I've got the necessary build configuration options set up correctly. I need to confirm: * `CFG80211` * `MAC80211` * `MAC80211_HWSIM` And just to be thorough, I'm going to quickly search the Kconfig files for "NAN" to see if there are any specific NAN-related configurations I'm missing. Got to have all my bases covered for the fuzzing run. This is going to be fun! |
| 24/2 | 2026/09/07 22:19 | tool | grepper |
0mError:no matches Args: {
"Expression": "NAN",
"PathPrefix": "net/wireless/Kconfig"
}Results: {
"error": "no matches"
} |
| 25/2 | 2026/09/07 22:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 26853 output: 32 thoughts: 18 Thoughts: Here's my take on those thoughts, tailored for an expert audience: **Kconfig Dive** Alright, time to get my hands dirty. My instinct says a potential issue related to the wireless stack warrants a look at the configuration options. Specifically, the `net/mac80211/Kconfig` file. I'm going to quickly review that file to check what the kernel configuration options might be. I'll need to confirm what the available options are, and if any are obviously related to the problem. I'm looking for a quick sanity check to see if a simple kernel reconfigure is the solution or if this requires further investigation. |
| 26/2 | 2026/09/07 22:19 | tool | grepper |
0mError:no matches Args: {
"Expression": "NAN",
"PathPrefix": "net/mac80211/Kconfig"
}Results: {
"error": "no matches"
} |
| 27/2 | 2026/09/07 22:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 27054 output: 36 thoughts: 24 Thoughts: Here's my take on the thought process, as if it were my own: **Investigating Wireless Driver Build Processes** Okay, so I need to understand how these wireless drivers are built, so I'll start with the obvious places. My instinct is that the core build logic for the mac80211 framework and any general wireless components will probably reside in those top-level `Makefile` files. Therefore, I need to check `net/mac80211/Makefile` and `net/wireless/Makefile`. Those are the logical starting points; I can probably find the inclusion of those files and see how those component parts are tied together. I'll need to review those files to understand the flow for this and see where the actual drivers fit into this overall structure. This should hopefully give me a high-level view of the build process and how the drivers are integrated. |
| 28/2 | 2026/09/07 22:19 | tool | read-file |
0mArgs:{
"File": "net/mac80211/Makefile",
"FirstLine": 1,
"LineCount": 40
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0\n 2:\tobj-$(CONFIG_MAC80211) += mac80211.o\n 3:\t\n 4:\t# mac80211 objects\n 5:\tmac80211-y := \\\n 6:\t\tmain.o status.o \\\n 7:\t\tdriver-ops.o \\\n 8:\t\tsta_info.o \\\n 9:\t\twep.o \\\n 10:\t\taead_api.o \\\n 11:\t\twpa.o \\\n 12:\t\tscan.o offchannel.o \\\n 13:\t\tht.o agg-tx.o agg-rx.o \\\n 14:\t\tvht.o \\\n 15:\t\the.o \\\n 16:\t\ts1g.o \\\n 17:\t\tibss.o \\\n 18:\t\tiface.o \\\n 19:\t\tlink.o \\\n 20:\t\trate.o \\\n 21:\t\ttkip.o \\\n 22:\t\taes_cmac.o \\\n 23:\t\taes_gmac.o \\\n 24:\t\tfils_aead.o \\\n 25:\t\tcfg.o \\\n 26:\t\tethtool.o \\\n 27:\t\trx.o \\\n 28:\t\tspectmgmt.o \\\n 29:\t\ttx.o \\\n 30:\t\tkey.o \\\n 31:\t\tutil.o parse.o \\\n 32:\t\twme.o \\\n 33:\t\tchan.o ap.o \\\n 34:\t\ttrace.o mlme.o \\\n 35:\t\ttdls.o \\\n 36:\t\tocb.o \\\n 37:\t\tairtime.o \\\n 38:\t\teht.o uhr.o nan.o\n 39:\t\n 40:\tmac80211-$(CONFIG_MAC80211_LEDS) += led.o\n"
} |
| 29/2 | 2026/09/07 22:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 27816 output: 300 thoughts: 886 Thoughts: **Analyzing NAN Channel Evacuation Logic for Fuzzing** Okay, so here's the breakdown of what I've been working through. First, I know that `nan.o` is inherently part of `mac80211.o` when `CONFIG_MAC80211` is enabled. Similarly, `nl80211.o` and `core.o` are built into `cfg80211.o` when `CONFIG_CFG80211` is active. This dictates the core modules in play. Now, I need to identify the key focus symbols for fuzzing. I've compiled a list: `nl80211_nan_set_non_evac_channels`, `nl80211_parse_non_evac_channel`, `cfg80211_nan_set_non_evac_channels`, `ieee80211_nan_set_non_evac_channels`, `ieee80211_set_nan_non_evac_channels`, and `ieee80211_nan_find_evac_chan`. Next, I need to determine their visibility. A quick check of the source reveals that `nl80211_nan_set_non_evac_channels` and `nl80211_parse_non_evac_channel` are static within `net/wireless/nl80211.c`. `cfg80211_nan_set_non_evac_channels` is located in `net/wireless/core.c`, while `ieee80211_set_nan_non_evac_channels` is static in `net/mac80211/cfg.c` and both `ieee80211_nan_set_non_evac_channels` and `ieee80211_nan_find_evac_chan` are in `net/mac80211/nan.c`. I have to remember to filter out `static inline` functions such as `rdev_nan_set_non_evac_channels`, which lives in `net/wireless/rdev-ops.h`, since those can't be directly called. The essential `EnableConfigs` for this are `CFG80211`, `MAC80211`, and `MAC80211_HWSIM`. Now, I'm ready to craft the `set-results` parameters. The fuzzing target is definitely `WorthFuzzing` due to the handling of a new netlink command, channel evacuation logic for NAN, the parsing of nested nl80211 attributes, and the fact that these are reachable via both netlink and mac80211 virtual interfaces. Therefore, the `Reasoning` will highlight this new code path, including its nested parsing logic. The `FocusSymbols` will be that full list of non-static functions. `EnableConfigs` will be the three configurations I've already identified. Before I actually make the call to `set-results`, I'll double-check that all of the function names and configs are correct. Functions: 1. `nl80211_nan_set_non_evac_channels` 2. `nl80211_parse_non_evac_channel` 3. `cfg80211_nan_set_non_evac_channels` 4. `ieee80211_set_nan_non_evac_channels` 5. `ieee80211_nan_set_non_evac_channels` 6. `ieee80211_nan_find_evac_chan` Configs: - `CFG80211` - `MAC80211` - `MAC80211_HWSIM` Okay, everything looks good. Time to call `set-results`. |
| 30/2 | 2026/09/07 22:19 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"CFG80211",
"MAC80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_nan_set_non_evac_channels",
"nl80211_parse_non_evac_channel",
"cfg80211_nan_set_non_evac_channels",
"ieee80211_set_nan_non_evac_channels",
"ieee80211_nan_set_non_evac_channels",
"ieee80211_nan_find_evac_chan"
],
"Reasoning": "The patch introduces a new generic netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS to configure non-evacuable NAN schedule channels. It adds netlink attribute parsing, verification logic against the current local schedule in cfg80211, driver/stack ops in mac80211, and modifies channel evacuation selection in mac80211. This code is reachable from user space via nl80211 sockets and virtual wireless devices (such as mac80211_hwsim).",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"CFG80211",
"MAC80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_nan_set_non_evac_channels",
"nl80211_parse_non_evac_channel",
"cfg80211_nan_set_non_evac_channels",
"ieee80211_set_nan_non_evac_channels",
"ieee80211_nan_set_non_evac_channels",
"ieee80211_nan_find_evac_chan"
],
"Reasoning": "The patch introduces a new generic netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS to configure non-evacuable NAN schedule channels. It adds netlink attribute parsing, verification logic against the current local schedule in cfg80211, driver/stack ops in mac80211, and modifies channel evacuation selection in mac80211. This code is reachable from user space via nl80211 sockets and virtual wireless devices (such as mac80211_hwsim).",
"WorthFuzzing": true
} |
| 31/1 | 2026/09/07 22:19 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 32/2 | 2026/09/07 22:19 | agent | kmsan-evaluator |
0mModel:core Args: null Results: {
"KMSANReasoning": "The patch introduces the netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS and mac80211/cfg80211 handlers to mark certain NAN local schedule channels as non-evacuable.\n\nAnalysis of uninitialized memory risks:\n1. No kernel structures or data are copied to user space (it is a setter command returning only an error status), precluding kernel-to-user info leaks.\n2. All dynamic allocations (struct cfg80211_nan_non_evac_channels, nlattr array) are allocated using zeroing allocators (kzalloc, kcalloc) and automatically managed via __free(kfree).\n3. The new bool field `no_evacuate` in struct ieee80211_nan_channel is explicitly initialized (cleared to false and set to true when matching).\n4. No branching or conditional logic reads uninitialized stack or heap data.\n\nAny potential memory safety or locking issues in this patch (such as out-of-bounds access, invalid pointers, or concurrency issues) are fully covered by standard KASAN and LOCKDEP configurations. Hence, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit a719a2aac1d73929d6baa057b81a9e9dfe4cc7c7
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Sep 7 22:18:38 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6461a7bd0169d..59d76a0daf2cb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4256,6 +4256,21 @@ struct cfg80211_nan_local_sched {
struct cfg80211_nan_channel nan_channels[] __counted_by(n_channels);
};
+/**
+ * struct cfg80211_nan_non_evac_channels - NAN non-evacuable channels
+ *
+ * This struct defines the set of NAN local schedule channels that must not
+ * be evacuated for concurrent operations.
+ *
+ * @n_channels: number of channel definitions in %chandefs.
+ * @chandefs: array of channel definitions that must not be evacuated. Each
+ * must match a channel of the current local schedule.
+ */
+struct cfg80211_nan_non_evac_channels {
+ u8 n_channels;
+ struct cfg80211_chan_def chandefs[] __counted_by(n_channels);
+};
+
/**
* struct cfg80211_nan_peer_map - NAN peer schedule map
*
@@ -5204,6 +5219,12 @@ struct mgmt_frame_regs {
* schedule, the full new schedule is provided - partial updates are not
* supported, and the new schedule completely replaces the previous one.
*
+ * @nan_set_non_evac_channels: set the list of local schedule channels that
+ * must not be evacuated for concurrent operations. The provided list
+ * replaces the previous set; channels of the current schedule that are
+ * not included become evacuable again. All provided channels are
+ * guaranteed by cfg80211 to belong to the current local schedule.
+ *
* @set_multicast_to_unicast: configure multicast to unicast conversion for BSS
*
* @get_txq_stats: Get TXQ stats for interface or phy. If wdev is %NULL, this
@@ -5590,6 +5611,9 @@ struct cfg80211_ops {
int (*nan_set_peer_sched)(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct cfg80211_nan_peer_sched *sched);
+ int (*nan_set_non_evac_channels)(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels);
int (*set_multicast_to_unicast)(struct wiphy *wiphy,
struct net_device *dev,
const bool enabled);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7bb4618065b67..33ff018c33ece 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -923,12 +923,14 @@ struct ieee80211_bss_conf {
* @channel_entry: the Channel Entry blob as defined in Wi-Fi Aware
* (TM) 4.0 specification Table 100 (Channel Entry format for the NAN
* Availability attribute).
+ * @no_evacuate: if set, this channel must not be evacuated
*/
struct ieee80211_nan_channel {
struct ieee80211_chan_req chanreq;
u8 needed_rx_chains;
struct ieee80211_chanctx_conf *chanctx_conf;
u8 channel_entry[6];
+ bool no_evacuate;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index d8fefefc11a95..fb300b0c4a287 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1383,6 +1383,13 @@
* from the device to perform an announced schedule update. See
* %NL80211_ATTR_NAN_SCHED_DEFERRED for more details.
* If not set, the schedule should be applied immediately.
+ * Setting a new schedule is always allowed and is never treated as an
+ * evacuation, even if it removes channels that were previously marked as
+ * non-evacuable with %NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS. The
+ * non-evacuable marking is a per-channel property of the schedule:
+ * channels that remain in the new schedule keep their marking, channels
+ * that are removed simply lose it, and newly added channels are
+ * evacuable by default.
* @NL80211_CMD_NAN_SCHED_UPDATE_DONE: Event sent to user space to notify that
* a deferred local NAN schedule update (requested with
* %NL80211_CMD_NAN_SET_LOCAL_SCHED and %NL80211_ATTR_NAN_SCHED_DEFERRED)
@@ -1427,6 +1434,28 @@
* @NL80211_CMD_STOP_PD: Stop the PD operation, identified by
* its %NL80211_ATTR_WDEV interface.
*
+ * @NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS: Set the list of NAN local schedule
+ * channels that must not be evacuated. NAN must be operational
+ * (%NL80211_CMD_START_NAN was executed) and a local schedule must have
+ * been set (%NL80211_CMD_NAN_SET_LOCAL_SCHED). The command carries zero
+ * or more nested %NL80211_ATTR_NAN_CHANNEL attributes, each identifying a
+ * channel (by its channel definition) of the current local schedule that
+ * must not be evacuated for concurrent operations. The provided list
+ * replaces the previous set of non-evacuable channels; channels of the
+ * current schedule that are not included become evacuable again. All
+ * provided channels must exist in the current local schedule, otherwise
+ * the command fails. This is used to protect channels carrying NDC or
+ * immutable schedules, whose evacuation would break existing NDP
+ * connections.
+ * The non-evacuable marking is a per-channel property of the current
+ * local schedule and only affects evacuation for concurrent operations;
+ * it does not prevent the schedule itself from being changed. Removing a
+ * channel from the schedule with %NL80211_CMD_NAN_SET_LOCAL_SCHED is a
+ * user-initiated change, not an evacuation, and is allowed even for a
+ * non-evacuable channel. Across a schedule update, channels that remain
+ * keep their non-evacuable marking, removed channels lose it, and newly
+ * added channels are evacuable by default; issue this command again to
+ * change the non-evacuable set.
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1705,6 +1734,8 @@ enum nl80211_commands {
NL80211_CMD_START_PD,
NL80211_CMD_STOP_PD,
+ NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 23f4f9ec86d0a..cdcf1f0577077 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -5973,6 +5973,18 @@ ieee80211_set_peer_nan_sched(struct wiphy *wiphy,
return ieee80211_nan_set_peer_sched(sdata, sched);
}
+static int
+ieee80211_set_nan_non_evac_channels(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+ lockdep_assert_wiphy(wiphy);
+
+ return ieee80211_nan_set_non_evac_channels(sdata, channels);
+}
+
const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -6091,4 +6103,5 @@ const struct cfg80211_ops mac80211_config_ops = {
.set_epcs = ieee80211_set_epcs,
.nan_set_local_sched = ieee80211_set_local_nan_sched,
.nan_set_peer_sched = ieee80211_set_peer_nan_sched,
+ .nan_set_non_evac_channels = ieee80211_set_nan_non_evac_channels,
};
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 53b0b08d34597..929fc8930a35e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2087,6 +2087,8 @@ int ieee80211_nan_set_local_sched(struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_local_sched *sched);
int ieee80211_nan_set_peer_sched(struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_peer_sched *sched);
+int ieee80211_nan_set_non_evac_channels(struct ieee80211_sub_if_data *sdata,
+ struct cfg80211_nan_non_evac_channels *channels);
void ieee80211_nan_free_peer_sched(struct ieee80211_nan_peer_sched *sched);
void ieee80211_nan_update_ndi_carrier(struct ieee80211_sub_if_data *ndi_sdata);
struct ieee80211_nan_channel *
diff --git a/net/mac80211/nan.c b/net/mac80211/nan.c
index 19e08661be43a..38bd105121acf 100644
--- a/net/mac80211/nan.c
+++ b/net/mac80211/nan.c
@@ -248,6 +248,35 @@ ieee80211_nan_find_free_channel(struct ieee80211_nan_sched_cfg *sched_cfg)
return NULL;
}
+int
+ieee80211_nan_set_non_evac_channels(struct ieee80211_sub_if_data *sdata,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ struct ieee80211_nan_sched_cfg *sched_cfg = &sdata->vif.cfg.nan_sched;
+
+ /*
+ * cfg80211 already validated that all provided channels belong to the
+ * current schedule, so just clear all non-evacuable flags and set the
+ * ones in the list.
+ */
+ for (int j = 0; j < ARRAY_SIZE(sched_cfg->channels); j++)
+ sched_cfg->channels[j].no_evacuate = false;
+
+ for (int i = 0; i < channels->n_channels; i++) {
+ for (int j = 0; j < ARRAY_SIZE(sched_cfg->channels); j++) {
+ if (!sched_cfg->channels[j].chanreq.oper.chan)
+ continue;
+ if (cfg80211_chandef_identical(&sched_cfg->channels[j].chanreq.oper,
+ &channels->chandefs[i])) {
+ sched_cfg->channels[j].no_evacuate = true;
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
int ieee80211_nan_set_local_sched(struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_local_sched *sched)
{
@@ -786,6 +815,10 @@ ieee80211_nan_find_evac_chan(struct ieee80211_local *local,
usable_channels++;
+ /* No-evacuate channel is usable but cannot be evacuated */
+ if (chan->no_evacuate)
+ continue;
+
chan_ctx = container_of(chan->chanctx_conf,
struct ieee80211_chanctx, conf);
diff --git a/net/wireless/core.c b/net/wireless/core.c
index d13310fef691a..2f46243773f94 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -325,6 +325,41 @@ int cfg80211_nan_set_local_schedule(struct cfg80211_registered_device *rdev,
return 0;
}
+int cfg80211_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ lockdep_assert_held(&rdev->wiphy.mtx);
+
+ if (wdev->iftype != NL80211_IFTYPE_NAN || !wdev_running(wdev))
+ return -EINVAL;
+
+ /*
+ * Don't allow updating the non-evacuable channels while a deferred
+ * schedule update is pending, as the set of channels may still change.
+ */
+ if (wdev->u.nan.sched_update_pending)
+ return -EBUSY;
+
+ /* All provided channels must belong to the current local schedule. */
+ for (int i = 0; i < channels->n_channels; i++) {
+ bool found = false;
+
+ for (int j = 0; j < wdev->u.nan.n_channels; j++) {
+ if (cfg80211_chandef_identical(&wdev->u.nan.chandefs[j],
+ &channels->chandefs[i])) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ return -ENOENT;
+ }
+
+ return rdev_nan_set_non_evac_channels(rdev, wdev, channels);
+}
+
void cfg80211_stop_pd(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
diff --git a/net/wireless/core.h b/net/wireless/core.h
index b4610f6685dcb..4ee48b9370800 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -565,6 +565,10 @@ int cfg80211_nan_set_local_schedule(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
struct cfg80211_nan_local_sched *sched);
+int cfg80211_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels);
+
struct cfg80211_internal_bss *
cfg80211_bss_update(struct cfg80211_registered_device *rdev,
struct cfg80211_internal_bss *tmp,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e585da1d79c9e..f44036ad43fb5 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -17763,6 +17763,69 @@ static int nl80211_nan_set_local_sched(struct sk_buff *skb,
return cfg80211_nan_set_local_schedule(rdev, wdev, sched);
}
+static int
+nl80211_parse_non_evac_channel(struct cfg80211_registered_device *rdev,
+ struct nlattr *channel, struct genl_info *info,
+ struct cfg80211_chan_def *chandef)
+{
+ struct nlattr **channel_parsed __free(kfree) =
+ kcalloc(NL80211_ATTR_MAX + 1, sizeof(*channel_parsed),
+ GFP_KERNEL);
+ int ret;
+
+ if (!channel_parsed)
+ return -ENOMEM;
+
+ ret = nla_parse_nested(channel_parsed, NL80211_ATTR_MAX, channel, NULL,
+ info->extack);
+ if (ret)
+ return ret;
+
+ return nl80211_parse_chandef(rdev, info->extack, channel_parsed,
+ chandef, false);
+}
+
+static int nl80211_nan_set_non_evac_channels(struct sk_buff *skb,
+ struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+ int rem, i = 0, n_channels = 0;
+ struct nlattr *channel;
+
+ if (wdev->iftype != NL80211_IFTYPE_NAN)
+ return -EOPNOTSUPP;
+
+ if (!wdev_running(wdev))
+ return -ENOTCONN;
+
+ /* Count how many channel attributes we got */
+ nlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,
+ info->nlhdr, GENL_HDRLEN, rem)
+ n_channels++;
+
+ struct cfg80211_nan_non_evac_channels *channels __free(kfree) =
+ kzalloc(struct_size(channels, chandefs, n_channels),
+ GFP_KERNEL);
+ if (!channels)
+ return -ENOMEM;
+
+ channels->n_channels = n_channels;
+
+ nlmsg_for_each_attr_type(channel, NL80211_ATTR_NAN_CHANNEL,
+ info->nlhdr, GENL_HDRLEN, rem) {
+ int ret;
+
+ ret = nl80211_parse_non_evac_channel(rdev, channel, info,
+ &channels->chandefs[i]);
+ if (ret)
+ return ret;
+ i++;
+ }
+
+ return cfg80211_nan_set_non_evac_channels(rdev, wdev, channels);
+}
+
static int nl80211_get_protocol_features(struct sk_buff *skb,
struct genl_info *info)
{
@@ -20619,6 +20682,12 @@ static const struct genl_small_ops nl80211_small_ops[] = {
.flags = GENL_ADMIN_PERM,
.internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),
},
+ {
+ .cmd = NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS,
+ .doit = nl80211_nan_set_non_evac_channels,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),
+ },
};
static struct genl_family nl80211_fam __ro_after_init = {
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 46849fe8d0b39..269258c94a42a 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1093,6 +1093,23 @@ rdev_nan_set_peer_sched(struct cfg80211_registered_device *rdev,
return ret;
}
+static inline int
+rdev_nan_set_non_evac_channels(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels)
+{
+ int ret;
+
+ trace_rdev_nan_set_non_evac_channels(&rdev->wiphy, wdev, channels);
+ if (rdev->ops->nan_set_non_evac_channels)
+ ret = rdev->ops->nan_set_non_evac_channels(&rdev->wiphy, wdev,
+ channels);
+ else
+ ret = -EOPNOTSUPP;
+ trace_rdev_return_int(&rdev->wiphy, ret);
+ return ret;
+}
+
static inline int rdev_start_pd(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 8c2a91b85c396..435dc58cafbed 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2483,6 +2483,31 @@ TRACE_EVENT(rdev_nan_set_peer_sched,
)
);
+TRACE_EVENT(rdev_nan_set_non_evac_channels,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
+ struct cfg80211_nan_non_evac_channels *channels),
+ TP_ARGS(wiphy, wdev, channels),
+ TP_STRUCT__entry(
+ WIPHY_ENTRY
+ WDEV_ENTRY
+ __field(u8, n_channels)
+ __dynamic_array(u32, freqs, channels->n_channels)
+ ),
+ TP_fast_assign(
+ u32 *freqs = __get_dynamic_array(freqs);
+
+ WIPHY_ASSIGN;
+ WDEV_ASSIGN;
+ __entry->n_channels = channels->n_channels;
+ for (int i = 0; i < channels->n_channels; i++)
+ freqs[i] = channels->chandefs[i].chan->center_freq;
+ ),
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", n_channels: %u, freqs: %s",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->n_channels,
+ __print_array(__get_dynamic_array(freqs),
+ __entry->n_channels, sizeof(u32)))
+);
+
TRACE_EVENT(rdev_set_mac_acl,
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
struct cfg80211_acl_data *params),
|
| 33/3 | 2026/09/07 22:19 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 8586 output: 26 thoughts: 1323 Thoughts: **Patch Analysis: NAN Non-Evacuable Channel Setting** Okay, let's break this patch down. It looks like we're introducing a mechanism to designate specific channels as non-evacuable within the NAN local schedule. This is achieved via a new Netlink command, `NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS`. First, I see the core data structures are being updated: a new `cfg80211_nan_non_evac_channels` struct is defined, essentially a container for a list of channel definitions. Then there's the `no_evacuate` flag being added to the `ieee80211_nan_channel` struct. This is the key – indicating whether a channel should be excluded from evacuation. The code changes confirm that the new command will set the non-evacuated channels. The `ieee80211_nan_set_non_evac_channels` function iterates through the provided channel list, and sets the `no_evacuate` flag accordingly. `ieee80211_nan_find_evac_chan` is modified to respect the new setting. `cfg80211_nan_set_non_evac_channels` in `core.c` performs important validation. It makes sure we're in NAN mode, the interface is running, and that the channel definitions we're being given actually match the channels that the device is configured to support, which is good. The call to `rdev_nan_set_non_evac_channels` signals that this is actually being handled by the driver. The Netlink side of things, handled in `nl80211.c`, is pretty standard. `nl80211_parse_non_evac_channel` parses the individual channel definitions from the Netlink message, and `nl80211_nan_set_non_evac_channels` does the heavy lifting: counting the channels, allocating memory, populating the `channels` struct, and ultimately calling the core function to set the non-evacuable channels. Memory allocation looks reasonable, with `kcalloc` and `kzalloc` being used, and initialization occurring. Now, a key concern: uninitialized memory. Let's make sure nothing is leaked to user space and that all data structures are properly initialized. Looks like there's no outputting of this information, this is a setter, so that's good. The allocations are all zeroed, which is a good starting point. However, the use of a tracepoint does catch my attention. It looks like it is reading channel center frequencies from the parsed `chandefs`, so I need to go deeper into `nl80211_parse_chandef` and the validation steps. The important validation is that `nl80211_parse_chandef` initializes `chandef`, and that validation in `cfg80211_nan_set_non_evac_channels` makes sure it's valid. Therefore, the trace event will work. Overall, this patch seems well-structured, but I will need to verify the implementation of `nl80211_parse_chandef` to ensure channel definitions are properly handled and validated before the tracepoint is called. |
| 34/3 | 2026/09/07 22:19 | tool | grepper |
0mError:no matches Args: {
"Expression": "def nl80211_parse_chandef"
}Results: {
"error": "no matches"
} |
| 35/3 | 2026/09/07 22:19 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 10677 output: 35 thoughts: 18 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Analyzing the `nl80211_parse_chandef` Function** Okay, so I need to understand what's happening with channel definition parsing. My immediate instinct, given the context is probably related to wireless networking, is to jump right in and find the definition of `nl80211_parse_chandef`. I want to see how this function handles channel definitions within the nl80211 framework. I'm assuming that it is responsible for extracting the channel parameters from whatever data structure is passed through the nl80211 interface - could be netlink attributes or something similar. I'm thinking this function will likely touch things like: * **Frequency:** The actual radio frequency in MHz. * **Channel Width:** This is crucial, as it determines the bandwidth used (e.g., 20MHz, 40MHz, 80MHz, 160MHz). I need to understand if the parsing handles all the common (and even some less common) widths. * **Center Frequency Segments:** If this is a wider channel, like 80MHz or 160MHz, then I'll look for how the function identifies the center frequencies of the segments. * **Regulatory Domain Handling:** How it deals with different regulatory domains and their restrictions on allowed channels and widths will be important. I bet there are checks against a regulatory database. * **Error Handling:** It's critical this function correctly identifies and handles invalid channel definitions. I want to see how robust the error checks are. Does it return specific error codes? Are there any potential vulnerabilities to buffer overflows or incorrect parsing of maliciously crafted channel definitions? My first step is definitely to grep for the function name and see the direct usage. Then I'll trace through the code, particularly where it interfaces with any nl80211 message processing. This is going to be interesting and I anticipate I might need to cross-reference it with the definitions of related structures and enums. |
| 36/3 | 2026/09/07 22:19 | tool | grepper |
0mArgs:{
"Expression": "nl80211_parse_chandef",
"PathPrefix": "net/wireless/"
}Results: {
"Output": "net/wireless/nl80211.c=3903=static bool nl80211_can_set_dev_channel(struct wireless_dev *wdev)\n--\nnet/wireless/nl80211.c-3926-\nnet/wireless/nl80211.c:3927:static int _nl80211_parse_chandef(struct cfg80211_registered_device *rdev,\nnet/wireless/nl80211.c-3928-\t\t\t\t struct netlink_ext_ack *extack,\n--\nnet/wireless/nl80211.c-4095-\nnet/wireless/nl80211.c:4096:int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,\nnet/wireless/nl80211.c-4097-\t\t\t struct netlink_ext_ack *extack,\n--\nnet/wireless/nl80211.c-4101-{\nnet/wireless/nl80211.c:4102:\treturn _nl80211_parse_chandef(rdev, extack, attrs, false, chandef,\nnet/wireless/nl80211.c-4103-\t\t\t\t permit_npca);\n--\nnet/wireless/nl80211.c=4106=static int __nl80211_set_channel(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/nl80211.c-4134-\nnet/wireless/nl80211.c:4135:\tresult = _nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/nl80211.c-4136-\t\t\t\t\tiftype == NL80211_IFTYPE_MONITOR,\n--\nnet/wireless/nl80211.c=7210=static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-7347-\tif (info-\u003eattrs[NL80211_ATTR_WIPHY_FREQ]) {\nnet/wireless/nl80211.c:7348:\t\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/nl80211.c-7349-\t\t\t\t\t \u0026params-\u003echandef, true);\n--\nnet/wireless/nl80211.c=12044=static int nl80211_start_radar_detection(struct sk_buff *skb,\n--\nnet/wireless/nl80211.c-12075-\nnet/wireless/nl80211.c:12076:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs, \u0026chandef,\nnet/wireless/nl80211.c-12077-\t\t\t\t false);\n--\nnet/wireless/nl80211.c=12148=static int nl80211_notify_radar_detection(struct sk_buff *skb,\n--\nnet/wireless/nl80211.c-12165-\nnet/wireless/nl80211.c:12166:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs, \u0026chandef,\nnet/wireless/nl80211.c-12167-\t\t\t\t false);\n--\nnet/wireless/nl80211.c=12239=static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-12305-\nnet/wireless/nl80211.c:12306:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/nl80211.c-12307-\t\t\t\t \u0026params.chandef, permit_npca);\n--\nnet/wireless/nl80211.c=13544=static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-13591-\nnet/wireless/nl80211.c:13592:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/nl80211.c-13593-\t\t\t\t \u0026ibss.chandef, false);\n--\nnet/wireless/nl80211.c=14583=static int nl80211_remain_on_channel(struct sk_buff *skb,\n--\nnet/wireless/nl80211.c-14622-\nnet/wireless/nl80211.c:14623:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs, \u0026chandef,\nnet/wireless/nl80211.c-14624-\t\t\t\t false);\n--\nnet/wireless/nl80211.c=14777=static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-14852-\tif (info-\u003eattrs[NL80211_ATTR_WIPHY_FREQ]) {\nnet/wireless/nl80211.c:14853:\t\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/nl80211.c-14854-\t\t\t\t\t \u0026chandef, false);\n--\nnet/wireless/nl80211.c=15255=static int nl80211_join_ocb(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-15261-\nnet/wireless/nl80211.c:15262:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/nl80211.c-15263-\t\t\t\t \u0026setup.chandef, false);\n--\nnet/wireless/nl80211.c=15278=static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)\n--\nnet/wireless/nl80211.c-15337-\tif (info-\u003eattrs[NL80211_ATTR_WIPHY_FREQ]) {\nnet/wireless/nl80211.c:15338:\t\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/nl80211.c-15339-\t\t\t\t\t \u0026setup.chandef, false);\n--\nnet/wireless/nl80211.c=17335=static int nl80211_parse_nan_channel(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/nl80211.c-17355-\nnet/wireless/nl80211.c:17356:\tret = nl80211_parse_chandef(rdev, info-\u003eextack, channel_parsed,\nnet/wireless/nl80211.c-17357-\t\t\t\t \u0026chandef, false);\n--\nnet/wireless/nl80211.c=17767=nl80211_parse_non_evac_channel(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/nl80211.c-17783-\nnet/wireless/nl80211.c:17784:\treturn nl80211_parse_chandef(rdev, info-\u003eextack, channel_parsed,\nnet/wireless/nl80211.c-17785-\t\t\t\t chandef, false);\n--\nnet/wireless/nl80211.c=18401=static int nl80211_tdls_channel_switch(struct sk_buff *skb,\n--\nnet/wireless/nl80211.c-18427-\nnet/wireless/nl80211.c:18428:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs, \u0026chandef,\nnet/wireless/nl80211.c-18429-\t\t\t\t false);\n--\nnet/wireless/nl80211.h=19=static inline u64 wdev_id(struct wireless_dev *wdev)\n--\nnet/wireless/nl80211.h-24-\nnet/wireless/nl80211.h:25:int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,\nnet/wireless/nl80211.h-26-\t\t\t struct netlink_ext_ack *extack,\n--\nnet/wireless/pmsr.c=309=static int pmsr_parse_peer(struct cfg80211_registered_device *rdev,\n--\nnet/wireless/pmsr.c-354-\nnet/wireless/pmsr.c:355:\terr = nl80211_parse_chandef(rdev, info-\u003eextack, info-\u003eattrs,\nnet/wireless/pmsr.c-356-\t\t\t\t \u0026out-\u003echandef, false);\n"
} |
| 37/3 | 2026/09/07 22:19 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 13773 output: 42 thoughts: 59 Thoughts: Here's my summary, as if I were thinking these thoughts: **Diving into the Channel Parsing Logic** Okay, time to get my hands dirty. I need to understand how the kernel handles non-evacuation and NAN channel parsing within the `nl80211` context. Let's zero in on `nl80211_parse_nan_channel` and `nl80211_parse_non_evac_channel`. I have a feeling there might be subtle differences or potential overlap in their implementation, especially given the similarities in their core function of dealing with channel configuration. The goal is to compare their logic, specifically around line 17335 in `net/wireless/nl80211.c`, to figure out any nuances. It will be interesting to explore how they handle channel parameters and whether there are any inconsistencies I should be aware of. Let's get to it! |
| 38/3 | 2026/09/07 22:19 | tool | read-file |
0mArgs:{
"File": "net/wireless/nl80211.c",
"FirstLine": 17335,
"LineCount": 40
}Results: {
"Contents": "17335:\tstatic int nl80211_parse_nan_channel(struct cfg80211_registered_device *rdev,\n17336:\t\t\t\t\t struct nlattr *channel,\n17337:\t\t\t\t\t struct genl_info *info,\n17338:\t\t\t\t\t struct cfg80211_nan_channel *nan_channels,\n17339:\t\t\t\t\t u8 index, bool local)\n17340:\t{\n17341:\t\tstruct nlattr **channel_parsed __free(kfree) = NULL;\n17342:\t\tstruct cfg80211_chan_def chandef;\n17343:\t\tu8 n_rx_nss;\n17344:\t\tint ret;\n17345:\t\n17346:\t\tchannel_parsed = kcalloc(NL80211_ATTR_MAX + 1, sizeof(*channel_parsed),\n17347:\t\t\t\t\t GFP_KERNEL);\n17348:\t\tif (!channel_parsed)\n17349:\t\t\treturn -ENOMEM;\n17350:\t\n17351:\t\tret = nla_parse_nested(channel_parsed, NL80211_ATTR_MAX, channel, NULL,\n17352:\t\t\t\t info-\u003eextack);\n17353:\t\tif (ret)\n17354:\t\t\treturn ret;\n17355:\t\n17356:\t\tret = nl80211_parse_chandef(rdev, info-\u003eextack, channel_parsed,\n17357:\t\t\t\t\t \u0026chandef, false);\n17358:\t\tif (ret)\n17359:\t\t\treturn ret;\n17360:\t\n17361:\t\tif (chandef.chan-\u003eband == NL80211_BAND_6GHZ) {\n17362:\t\t\tNL_SET_ERR_MSG(info-\u003eextack,\n17363:\t\t\t\t \"6 GHz band is not supported\");\n17364:\t\t\treturn -EOPNOTSUPP;\n17365:\t\t}\n17366:\t\n17367:\t\tif (!cfg80211_reg_can_beacon(\u0026rdev-\u003ewiphy, \u0026chandef,\n17368:\t\t\t\t\t NL80211_IFTYPE_NAN)) {\n17369:\t\t\tNL_SET_ERR_MSG_ATTR(info-\u003eextack, channel,\n17370:\t\t\t\t\t \"Channel in NAN schedule is not allowed for NAN operation\");\n17371:\t\t\treturn -EINVAL;\n17372:\t\t}\n17373:\t\n17374:\t\tif (local) {\n"
} |
| 39/3 | 2026/09/07 22:19 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 14779 output: 291 thoughts: 1198 Thoughts: **KMSAN Assessment: No Uninitialized Memory Risks** Okay, let's take a look at this `nl80211_nan_set_non_evac_channels` function. My initial thought is to make sure there's no subtle uninitialized memory access lurking around. The code itself looks pretty straightforward, handling the setting of non-evacuable channels for NAN. First, I examined the flow: It parses channel attributes from a Netlink message, allocates a structure (`channels`) to hold the channel definitions, populates it, and then passes it along. I noted that even if `n_channels` is zero (meaning no channel attributes are provided), the allocation still works correctly, allocating a struct with a zero-length array. The code correctly handles this edge case with no ill effects. Now, I paid close attention to where memory is allocated and initialized. Both `channels` and the intermediary `channel_parsed` within `nl80211_parse_non_evac_channel` are zeroed via `kzalloc` or `kcalloc`. This is good practice. I confirmed that `nl80211_parse_chandef` properly populates the fields and that all fields in `sched_cfg->channels` (or its equivalents) are explicitly set. There's no chance of uninitialized data leaking into user space via copies or responses. Crucially, there's no conditional branching based on uninitialized data. Given this analysis, I'm confident there are no KMSAN-specific issues. The core logic handles allocation, initialization, and deallocation of memory in a safe manner. Potential concurrency, index-related or memory safety issues are likely covered by standard kernel bug detectors like KASAN, LOCKDEP, and UBSAN. There is no information or data leaked back to userspace, and no struct fields are read without being initialized. Therefore, there's no justification to run KMSAN for this. We can safely mark this patch as not needing KMSAN. |
| 40/3 | 2026/09/07 22:19 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch introduces the netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS and mac80211/cfg80211 handlers to mark certain NAN local schedule channels as non-evacuable.\n\nAnalysis of uninitialized memory risks:\n1. No kernel structures or data are copied to user space (it is a setter command returning only an error status), precluding kernel-to-user info leaks.\n2. All dynamic allocations (struct cfg80211_nan_non_evac_channels, nlattr array) are allocated using zeroing allocators (kzalloc, kcalloc) and automatically managed via __free(kfree).\n3. The new bool field `no_evacuate` in struct ieee80211_nan_channel is explicitly initialized (cleared to false and set to true when matching).\n4. No branching or conditional logic reads uninitialized stack or heap data.\n\nAny potential memory safety or locking issues in this patch (such as out-of-bounds access, invalid pointers, or concurrency issues) are fully covered by standard KASAN and LOCKDEP configurations. Hence, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch introduces the netlink command NL80211_CMD_NAN_SET_NON_EVAC_CHANNELS and mac80211/cfg80211 handlers to mark certain NAN local schedule channels as non-evacuable.\n\nAnalysis of uninitialized memory risks:\n1. No kernel structures or data are copied to user space (it is a setter command returning only an error status), precluding kernel-to-user info leaks.\n2. All dynamic allocations (struct cfg80211_nan_non_evac_channels, nlattr array) are allocated using zeroing allocators (kzalloc, kcalloc) and automatically managed via __free(kfree).\n3. The new bool field `no_evacuate` in struct ieee80211_nan_channel is explicitly initialized (cleared to false and set to true when matching).\n4. No branching or conditional logic reads uninitialized stack or heap data.\n\nAny potential memory safety or locking issues in this patch (such as out-of-bounds access, invalid pointers, or concurrency issues) are fully covered by standard KASAN and LOCKDEP configurations. Hence, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|