Skip to content

fix backchannel crash due to multipath

J. Bruce Fields linux-nfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3SUNRPC: fix xprt leak on xps allocation failurenet/sunrpc/clnt.c+3 -20 replies
2/3nfsd4/rpc: move backchannel create logic into rpc codefs/nfsd/nfs4callback.c include/linux/sunrpc/clnt.h net/sunrpc/clnt.c+11 -210 replies
3/3rpc: share one xps between all backchannelsinclude/linux/sunrpc/svc_xprt.h include/linux/sunrpc/xprt.h net/sunrpc/clnt.c +2 more+19 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] fix backchannel crash due to multipath

From: "J. Bruce Fields" <[email protected]>

pynfs can crash the nfs server since the new multipath code. The problem is that pynfs uses the same tcp connection for multiple v4 clients (something the spec explicitly allows). The callback client in such cases has to share the same rpc_xprt. The new rpc code, when it creates two callback clients sharing the same rpc_xprt, ends up trying to keep that rpc_xprt on the lists of two different rpc_xprt_switch's. The first symptom I see is a list corruption warning.

So, I'm enforcing the requirement that there be only one backchannel rpc_xprt_switch per tcp connection by doing as we do in the rpc_xprt
case: keeping a pointer to it in the svc_xprt, and using that when it's available instead of allocating a new one.

That's a pretty straightforward fix (and I've verified it works), but doesn't look very elegant. If there's a better solution, I'm all ears.

--b.

J. Bruce Fields (3):
SUNRPC: fix xprt leak on xps allocation failure nfsd4/rpc: move backchannel create logic into rpc code
rpc: share one xps between all backchannels

 fs/nfsd/nfs4callback.c          | 18 +-----------------
 include/linux/sunrpc/clnt.h     |  2 --
 include/linux/sunrpc/svc_xprt.h |  1 +
 include/linux/sunrpc/xprt.h     |  1 +
 net/sunrpc/clnt.c               | 31 +++++++++++++++++++++++++------
 net/sunrpc/svc_xprt.c           |  2 ++
 net/sunrpc/xprtsock.c           |  1 +
 7 files changed, 31 insertions(+), 25 deletions(-)
Signature · 1 line
2.5.5