]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFSD: Prevent NULL dereference in nfsd4_process_cb_update()
authorChuck Lever <chuck.lever@oracle.com>
Thu, 17 Oct 2024 15:03:53 +0000 (11:03 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 19 Nov 2024 01:23:01 +0000 (20:23 -0500)
@ses is initialized to NULL. If __nfsd4_find_backchannel() finds no
available backchannel session, setup_callback_client() will try to
dereference @ses and segfault.

Fixes: dcbeaa68dbbd ("nfsd4: allow backchannel recovery")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4callback.c

index f5ba9be917700b6d16aba41e70de1ddd86f09a95..1ffac2b32d81a3cd94c0801ac83015dc9b9c0950 100644 (file)
@@ -1464,6 +1464,8 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb)
                ses = c->cn_session;
        }
        spin_unlock(&clp->cl_lock);
+       if (!c)
+               return;
 
        err = setup_callback_client(clp, &conn, ses);
        if (err) {