All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] SUNRPC: Fix backchannel transport lifetime bugs
@ 2026-11-04 17:49 Chuck Lever
  2026-11-04 17:49 ` [PATCH 1/5] SUNRPC: Reject add_xprt on a backchannel xprt_switch Chuck Lever
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Chuck Lever @ 2026-11-04 17:49 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker, Jeff Layton, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey
  Cc: Wentao Liang, linux-nfs, linux-rdma, Chuck Lever

Wentao Liang posted a fix for a reference leak in the RDMA
backchannel transport:

https://patch.msgid.link/20261104022813.1484267-1-vulab@iscas.ac.cn

Since commit 729580ddc53e ("svcrdma: xpt_bc_xprt is already clear in
__svc_rdma_free()"), xprt_setup_rdma_bc() takes one more reference
than anything releases, so no RDMA backchannel rpc_xprt is ever freed.

Applying Wentao's fix brings the final put back into play. The last
put queues xprt_destroy_cb(), which calls xprt_rdma_bc_put() in
rpcrdma, and nothing holds a module reference across that work item.
An rmmod of rpcrdma can then race the work item and run freed module
text. The module reference added right after Wentao's fix closes that
race, so the two need to land together.

This repost keeps Wentao's code as posted, with a reworded commit
message.

The series also addresses some pre-existing issues in the same area
that turned up while reviewing Wentao's patch: a NULL xprt_class on
the RDMA backchannel transport, an add_xprt sysfs write that rebinds
xpt_bc_xprt, and an xprt_create_transport() error path that leaves
xpt_bc_xprt pointing at a freed transport.

The add_xprt rejection has to come before setting xprt_class.
Currently an add_xprt write on the xprt_switch of an RDMA callback
client oopses on the NULL xprt_class. Setting xprt_class without the
rejection turns the oops into a leak of the previous backchannel
rpc_xprt. With the module reference in place, the leak also keeps
rpcrdma from being unloaded.

The SUNRPC patches change client-side code: the sysfs add_xprt handler
and xprt_create_transport(). Because of the ordering constraints
above, can the whole series, Wentao's fix included, go through the
NFS client tree?

---
Chuck Lever (4):
      SUNRPC: Reject add_xprt on a backchannel xprt_switch
      svcrdma: Hold a module reference for the backchannel transport
      svcrdma: Set xprt_class on the backchannel transport
      SUNRPC: Set up the servername before the transport is created

Wentao Liang (1):
      svcrdma: drop the extra reference on the backchannel transport

 net/sunrpc/sysfs.c                         |  6 ++++++
 net/sunrpc/xprt.c                          | 23 ++++++++++++-----------
 net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 12 ++++++++----
 3 files changed, 26 insertions(+), 15 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261104-liange-1630f2aaf1e9

Best regards,
--  
Chuck Lever


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

end of thread, other threads:[~2026-11-04 18:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 17:49 [PATCH 0/5] SUNRPC: Fix backchannel transport lifetime bugs Chuck Lever
2026-11-04 17:49 ` [PATCH 1/5] SUNRPC: Reject add_xprt on a backchannel xprt_switch Chuck Lever
2026-11-04 17:59   ` sashiko-bot
2026-11-04 17:49 ` [PATCH 2/5] svcrdma: drop the extra reference on the backchannel transport Chuck Lever
2026-11-04 18:03   ` sashiko-bot
2026-11-04 17:49 ` [PATCH 3/5] svcrdma: Hold a module reference for " Chuck Lever
2026-11-04 18:04   ` sashiko-bot
2026-11-04 17:49 ` [PATCH 4/5] svcrdma: Set xprt_class on " Chuck Lever
2026-11-04 17:53   ` sashiko-bot
2026-11-04 17:49 ` [PATCH 5/5] SUNRPC: Set up the servername before the transport is created Chuck Lever
2026-11-04 17:54   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.