Skip to content

Commit 9e9fdd0

Browse files
Olga KornievskaiaTrond Myklebust
authored andcommitted
NFSv4.1: protect destroying and nullifying bc_serv structure
When we are shutting down the client, we free the callback server structure and then at a later pointer we free the transport used by the client. Yet, it's possible that after the callback server is freed, the transport receives a backchannel request at which point we can dereferene freed memory. Instead, do the freeing the bc server and nullying bc_serv under the lock. Signed-off-by: Olga Kornievskaia <okorniev@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent 6f8b26c commit 9e9fdd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfs/callback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void nfs_callback_down(int minorversion, struct net *net, struct rpc_xprt *xprt)
270270
if (cb_info->users == 0) {
271271
svc_set_num_threads(serv, NULL, 0);
272272
dprintk("nfs_callback_down: service destroyed\n");
273-
svc_destroy(&cb_info->serv);
273+
xprt_svc_destroy_nullify_bc(xprt, &cb_info->serv);
274274
}
275275
mutex_unlock(&nfs_callback_mutex);
276276
}

0 commit comments

Comments
 (0)