protect access to bc_serv
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest4 patches 0 repliesNew
- v34 patches 2 repliesSuperseded
- v23 patches 2 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 3 patches | 0 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | NFSv4.1: pass transport for callback shutdownfs/ fs/ fs/ | +10 | 0 replies | |
| 2/4 | SUNRPC: cleanup common code in backchannel requestinclude/ net/ net/ | +19 | 0 replies | |
| 3/4 | SUNRPC: new helper function for stopping backchannel serverinclude/ net/ | +22 | 0 replies | |
| 4/4 | NFSv4.1: protect destroying and nullifying bc_serv structurefs/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/4] protect access to bc_serv
This patch series tries to address the problem that can arise when the client is shutting down but gets a backchannel request. As it stands now, In nfs4_shutdown_client() we call nfs4_destroy_callback() which would destroy/free the bc_serv structure stored in an xprt structure. But the xprt structure is still around for a bit until it's destroyed. If we get backchannel request after svc_destroy() is called, then in xprt_complete_bc_request() we are accessing freed memory.
I propose to use bc_pa_lock lock to protect access to the bc_serv structure and make sure we free/nullify bc_serv under the lock and then access it under a lock in xs_complete_bs_request() and rpcrdma_bc_receive_call().
-- v4 addressing Anna's comments and compile issue.
-- v3 Addressing Anna'a comments. (1) created function for shared code between tcp/rdma backchannel and (2) created xprt_svc_destroy_nullify_bc() for both on/off CONFIG_SUNRPC_BACKCHANNEL values.
-- v2 fixing kernel test bot reported compile error in usage of xprt_svc_destroy_nullify_bc (CONFIG_SUNRPC_BACKCHANNEL toggle related)
Olga Kornievskaia (4):
NFSv4.1: pass transport for callback shutdown
SUNRPC: cleanup common code in backchannel request
SUNRPC: new helper function for stopping backchannel server NFSv4.1: protect destroying and nullifying bc_serv structure
fs/nfs/callback.c | 4 ++-- fs/nfs/callback.h | 3 ++- fs/nfs/nfs4client.c | 9 ++++++-- include/linux/sunrpc/bc_xprt.h | 7 +++++++ net/sunrpc/backchannel_rqst.c | 35 ++++++++++++++++++++++++++++--- net/sunrpc/xprtrdma/backchannel.c | 8 ++----- 6 files changed, 52 insertions(+), 14 deletions(-)
Signature · 1 line
2.47.1