linux-stable/net/wireless
Michal Kazior 29df20cae2 wifi: cfg80211: fix missing interfaces when dumping
[ Upstream commit a6e4f85d38 ]

The nl80211_dump_interface() supports resumption
in case nl80211_send_iface() doesn't have the
resources to complete its work.

The logic would store the progress as iteration
offsets for rdev and wdev loops.

However the logic did not properly handle
resumption for non-last rdev. Assuming a system
with 2 rdevs, with 2 wdevs each, this could
happen:

 dump(cb=[0, 0]):
  if_start=cb[1] (=0)
  send rdev0.wdev0 -> ok
  send rdev0.wdev1 -> yield
  cb[1] = 1

 dump(cb=[0, 1]):
  if_start=cb[1] (=1)
  send rdev0.wdev1 -> ok
  // since if_start=1 the rdev0.wdev0 got skipped
  // through if_idx < if_start
  send rdev1.wdev1 -> ok

The if_start needs to be reset back to 0 upon wdev
loop end.

The problem is actually hard to hit on a desktop,
and even on most routers. The prerequisites for
this manifesting was:
 - more than 1 wiphy
 - a few handful of interfaces
 - dump without rdev or wdev filter

I was seeing this with 4 wiphys 9 interfaces each.
It'd miss 6 interfaces from the last wiphy
reported to userspace.

Signed-off-by: Michal Kazior <michal@plume.com>
Link: https://msgid.link/20240116142340.89678-1-kazikcz@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-01 13:34:48 +01:00
..
certs wifi: cfg80211: fix certs build to not depend on file order 2024-01-01 12:42:39 +00:00
.gitignore
ap.c wifi: nl80211: add MLO_LINK_ID to CMD_STOP_AP event 2023-02-14 12:09:17 +01:00
chan.c wifi: cfg80211: move puncturing bitmap validation from mac80211 2023-02-14 12:09:18 +01:00
core.c wifi: cfg80211: fix wiphy delayed work queueing 2024-02-23 09:25:12 +01:00
core.h wifi: cfg80211: fix CQM for non-range use 2024-01-05 15:19:44 +01:00
debugfs.c wifi: cfg80211: debugfs: fix return type in ht40allow_map_read() 2022-08-25 10:04:46 +02:00
debugfs.h
ethtool.c wifi: cfg80211: use strscpy to replace strlcpy 2022-07-15 11:43:12 +02:00
ibss.c wifi: cfg80211: remove support for static WEP 2023-01-18 17:31:44 +01:00
Kconfig
lib80211.c
lib80211_crypt_ccmp.c wifi: use struct_group to copy addresses 2022-09-03 16:40:06 +02:00
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
Makefile
mesh.c wifi: cfg80211: do some rework towards MLO link APIs 2022-06-20 12:54:58 +02:00
mlme.c wifi: cfg80211: fix assoc response warning on failed links 2023-10-23 13:25:30 +02:00
nl80211.c wifi: cfg80211: fix missing interfaces when dumping 2024-03-01 13:34:48 +01:00
nl80211.h wifi: nl80211: Remove unused declaration nl80211_pmsr_dump_results() 2023-08-22 21:40:40 +02:00
ocb.c wifi: cfg80211: ocb: don't leave if not joined 2023-08-22 21:40:39 +02:00
of.c
pmsr.c wifi: cfg80211: Annotate struct cfg80211_pmsr_request with __counted_by 2023-08-22 13:18:16 +02:00
radiotap.c
rdev-ops.h wifi: cfg80211: add inform_bss op to update BSS 2023-06-19 12:05:28 +02:00
reg.c wifi: nl80211/reg: add no-EHT regulatory flag 2023-06-21 14:01:29 +02:00
reg.h
scan.c wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update 2024-02-05 20:14:34 +00:00
sme.c wifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal 2023-06-19 12:08:40 +02:00
sysfs.c wifi: cfg80211: add flush functions for wiphy work 2023-11-20 11:58:54 +01:00
sysfs.h
trace.c
trace.h wifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal 2023-06-19 12:08:40 +02:00
util.c wifi: cfg80211: fix receiving mesh packets without RFC1042 header 2023-07-12 18:03:40 -07:00
wext-compat.c wifi: cfg80211: remove support for static WEP 2023-01-18 17:31:44 +01:00
wext-compat.h wifi: cfg80211: Avoid clashing function prototypes 2022-11-16 11:31:47 +02:00
wext-core.c wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point() 2023-06-19 12:05:27 +02:00
wext-priv.c
wext-proc.c
wext-sme.c wifi: cfg80211: wext: hold wiphy lock in siwgenie 2023-06-07 19:53:11 +02:00
wext-spy.c