Skip to content

Commit c854758

Browse files
committed
wifi: radiotap: reject radiotap with unknown bits
The radiotap parser is currently only used with the radiotap namespace (not with vendor namespaces), but if the undefined field 18 is used, the alignment/size is unknown as well. In this case, iterator->_next_ns_data isn't initialized (it's only set for skipping vendor namespaces), and syzbot points out that we later compare against this uninitialized value. Fix this by moving the rejection of unknown radiotap fields down to after the in-namespace lookup, so it will really use iterator->_next_ns_data only for vendor namespaces, even in case undefined fields are present. Cc: stable@vger.kernel.org Fixes: 33e5a2f ("wireless: update radiotap parser") Reported-by: syzbot+b09c1af8764c0097bb19@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/69944a91.a70a0220.2c38d7.00fc.GAE@google.com Link: https://patch.msgid.link/20260217120526.162647-2-johannes@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 767d23a commit c854758

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/wireless/radiotap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,14 @@ int ieee80211_radiotap_iterator_next(
239239
default:
240240
if (!iterator->current_namespace ||
241241
iterator->_arg_index >= iterator->current_namespace->n_bits) {
242-
if (iterator->current_namespace == &radiotap_ns)
243-
return -ENOENT;
244242
align = 0;
245243
} else {
246244
align = iterator->current_namespace->align_size[iterator->_arg_index].align;
247245
size = iterator->current_namespace->align_size[iterator->_arg_index].size;
248246
}
249247
if (!align) {
248+
if (iterator->current_namespace == &radiotap_ns)
249+
return -ENOENT;
250250
/* skip all subsequent data */
251251
iterator->_arg = iterator->_next_ns_data;
252252
/* give up on this namespace */

0 commit comments

Comments
 (0)