public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.7 01/23] wifi: cfg80211: fix missing interfaces when dumping
@ 2024-02-02 18:38 Sasha Levin
  2024-02-02 18:38 ` [PATCH AUTOSEL 6.7 02/23] wifi: mac80211: fix race condition on enabling fast-xmit Sasha Levin
                   ` (21 more replies)
  0 siblings, 22 replies; 25+ messages in thread
From: Sasha Levin @ 2024-02-02 18:38 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Michal Kazior, Johannes Berg, Sasha Levin, johannes, davem,
	edumazet, kuba, pabeni, linux-wireless, netdev

From: Michal Kazior <michal@plume.com>

[ Upstream commit a6e4f85d3820d00694ed10f581f4c650445dbcda ]

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>
---
 net/wireless/nl80211.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1cbbb11ea503..fbf95b7ff6b4 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4008,6 +4008,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
 		}
 		wiphy_unlock(&rdev->wiphy);
 
+		if_start = 0;
 		wp_idx++;
 	}
  out:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2024-02-22 14:58 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 18:38 [PATCH AUTOSEL 6.7 01/23] wifi: cfg80211: fix missing interfaces when dumping Sasha Levin
2024-02-02 18:38 ` [PATCH AUTOSEL 6.7 02/23] wifi: mac80211: fix race condition on enabling fast-xmit Sasha Levin
2024-02-02 18:38 ` [PATCH AUTOSEL 6.7 03/23] fbdev: savage: Error out if pixclock equals zero Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 04/23] fbdev: sis: " Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 05/23] dpll: fix broken error path in dpll_pin_alloc(..) Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 06/23] platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 07/23] spi: intel-pci: Add support for Arrow Lake SPI serial flash Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 08/23] x86/cpu: Add model number for Intel Clearwater Forest processor Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 09/23] spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 10/23] block: Fix WARNING in _copy_from_iter Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 11/23] smb: Work around Clang __bdos() type confusion Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 12/23] cifs: cifs_pick_channel should try selecting active channels Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 13/23] cifs: translate network errors on send to -ECONNABORTED Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 14/23] cifs: helper function to check replayable error codes Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 15/23] ahci: asm1166: correct count of reported ports Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 16/23] aoe: avoid potential deadlock at set_capacity Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 17/23] spi: cs42l43: Handle error from devm_pm_runtime_enable Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 18/23] exec: Distinguish in_execve from in_exec Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 19/23] ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers Sasha Levin
2024-02-22 14:58   ` Niklas Cassel
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 20/23] ARM: dts: Fix TPM schema violations Sasha Levin
2024-02-02 19:20   ` Lukas Wunner
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 21/23] drm/amd/display: Disable ips before dc interrupt setting Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 22/23] MIPS: reserve exception vector space ONLY ONCE Sasha Levin
2024-02-02 18:39 ` [PATCH AUTOSEL 6.7 23/23] platform/x86: touchscreen_dmi: Add info for the TECLAST X16 Plus tablet Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox