Skip to content

devlink: Fix RCU stall when unregistering a devlink instance

Ido Schimmel stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2devlink: drop the filter argument from devlinks_xa_find_getnet/devlink/leftover.c+8 -130 replies
2/2devlink: bump the instance index directly when iteratingnet/devlink/leftover.c+10 -250 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJiri PirkoJacob Keller
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH stable 6.1 0/2] devlink: Fix RCU stall when unregistering a devlink instance

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/[email protected]/

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(-)
Signature · 1 line
2.47.0