From 951cf3bc525e30c290318f50b14ef83b9dff13b7 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Tue, 11 Mar 2025 08:51:19 +0900 Subject: [PATCH] NFSD: Prevent NULL dereference in nfsd4_process_cb_update() BugLink: https://bugs.launchpad.net/bugs/2101915 [ Upstream commit 1e02c641c3a43c88cecc08402000418e15578d38 ] @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 Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin CVE-2024-53217 Signed-off-by: Koichiro Den Signed-off-by: Stefan Bader --- fs/nfsd/nfs4callback.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 30aa241038eb..c8d654c50f6e 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1450,6 +1450,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) {