Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH stable 6.1 0/2] devlink: Fix RCU stall when unregistering a devlink instance
@ 2024-10-15 11:36 Ido Schimmel
  2024-10-15 11:36 ` [PATCH stable 6.1 1/2] devlink: drop the filter argument from devlinks_xa_find_get Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2024-10-15 11:36 UTC (permalink / raw)
  To: stable
  Cc: davem, kuba, pabeni, edumazet, jiri, jacob.e.keller, gregkh,
	sashal, vkarri, nogikh, Ido Schimmel

Upstream commit c2368b19807a ("net: devlink: introduce "unregistering"
mark and use it during devlinks iteration") in v6.0 introduced a race
when unregistering a devlink instance that can result in RCU stalls and
in the system completely locking up. Exact details and reproducer can be
found here [1]. The bug was inadvertently fixed in v6.3 by upstream
commit d77278196441 ("devlink: bump the instance index directly when
iterating").

This patchset fixes the bug by backporting the second commit and a
related dependency from v6.3 to v6.1.y while adjusting them to the
devlink file structure in v6.1.y (net/devlink/{core.c,devl_internal.h}
-> net/devlink/leftover.c).

Tested by running the devlink tests under
tools/testing/selftests/drivers/net/netdevsim/ and the reproducer
mentioned in [1].

[1] https://lore.kernel.org/stable/20241001112035.973187-1-idosch@nvidia.com/

Jakub Kicinski (2):
  devlink: drop the filter argument from devlinks_xa_find_get
  devlink: bump the instance index directly when iterating

 net/devlink/leftover.c | 40 ++++++++++------------------------------
 1 file changed, 10 insertions(+), 30 deletions(-)

-- 
2.47.0


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

end of thread, other threads:[~2024-10-18  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15 11:36 [PATCH stable 6.1 0/2] devlink: Fix RCU stall when unregistering a devlink instance Ido Schimmel
2024-10-15 11:36 ` [PATCH stable 6.1 1/2] devlink: drop the filter argument from devlinks_xa_find_get Ido Schimmel
2024-10-15 11:36 ` [PATCH stable 6.1 2/2] devlink: bump the instance index directly when iterating Ido Schimmel
2024-10-18  8:48 ` [PATCH stable 6.1 0/2] devlink: Fix RCU stall when unregistering a devlink instance Greg KH

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