Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46D9958FD13 for ; Fri, 11 Sep 2026 20:05:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789157120; cv=none; b=uv6rXCCfDdKm0igH0CG4p9r5emHaUIyTD5NW5xvUO2lZTXH4aMN0z4ykpv+VNkuY/5Ts/LjZWVf158gWkHVZCC2miE0j/2J7uQGI7WDhUcTFnOfQNG/WhrVSKej3iEy6mMsCiu2Khn39NH+LabwoSvb03h8SSvZ+41YOJJVLM2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789157120; c=relaxed/simple; bh=PvWregphUz8x9cYpn+l4sTAh1md/Bqq5q6gsyrHmO3A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Z/TD/6R76C9n7h4/meMN9lmGoDvGHgmULean6na2Jj0B6ApXhNwQLXVFq7ioRjUyMFPlv4z/3ao3dRpTaYOt2mMUoik5oTgDmzW3MYGTq2XXpNQ9XkYqSoweDnsRRIVsQPh/2PK1bID9JpK9wHClbPYlzb71MWI8Utr00Ni5a1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TFrlZTGZ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TFrlZTGZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6B6E1F00893; Fri, 11 Sep 2026 20:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789157117; bh=lL8o0cUByygESNvgNVEJKqKpJQW4gSAgxdOnxshCKV0=; h=From:To:Cc:Subject:Date:Reply-To; b=TFrlZTGZSOKJlP4lWXDHzcGMy5yY15cH0DK2/x3G0uhykRdlbFWWtOYz5TBBJzVWp cUGDIE1k1BrnBdPOED2DN9yttlSGe5HVtwij9tn0+TLEm0XYPT2KYmA5E2iqiGvLd2 1oSlmQwFZatUONZR4nevlrJVJ2Ud3ctU1o8dsKtU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-89708: nfsd: RCU-protect cl_cb_session to fix use-after-free on session teardown Date: Fri, 11 Sep 2026 21:46:37 +0200 Message-ID: <2026091157-CVE-2026-89708-f3f2@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4698; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Ko7SWAxt/Cs3YtOZ0jmPrtY7LBPcUuxFiqhuiR+LGYU=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlLIlu3J7tPWJXfoR8jMeleu8K8rSF3Jj5/tmldJtOZX of/fVWeHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCROAWG+QUFe/d/O/yv+GFr +vffi2Yd/3A12JBhwQI9pSahRJYA1s7GddnbXx30zmm+AwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: nfsd: RCU-protect cl_cb_session to fix use-after-free on session teardown After a DESTROY_SESSION the per-session teardown path can free a session while rpciod still holds an inflight callback rpc_task that dereferences clp->cl_cb_session. nfsd4_probe_callback_sync() flushes cl_callback_wq, but once nfsd4_run_cb_work() has called rpc_call_async() the rpc_task lives on rpciod; flushing the workqueue does not wait for it. rpc_shutdown_client() does drain rpciod tasks, but uses a 1-second wait_event_timeout — tasks stuck in rpc_delay() (e.g. 2-second NFS4ERR_DELAY retries) can outlive the drain. destroy path rpciod ------------ ------ unhash_session(ses) nfsd4_probe_callback_sync(clp) flush_workqueue(cl_callback_wq) /* returns; rpc_task still live */ nfsd4_put_session_locked(ses) free_session(ses) -> kfree(ses) nfsd4_cb_sequence_done() reads cb_clp->cl_cb_session /* freed slab */ A second window exists in nfsd4_process_cb_update(). When __nfsd4_find_backchannel() returns NULL because unhash_session() has already removed the destroyed session from cl_sessions, setup_callback_client() takes the v4.1 early return so clp->cl_cb_session = ses never fires and the field retains a pointer to the about-to-be-freed session. Fix both by converting cl_cb_session to an RCU-protected pointer: - Move the cl_cb_session = ses assignment in setup_callback_client() to after rpc_create() succeeds, so it is only published when a working backchannel exists. Clear cl_cb_session on the error return in nfsd4_process_cb_update(). Both stores use rcu_assign_pointer(). - Annotate cl_cb_session with __rcu. All rpciod-side readers use rcu_read_lock()/rcu_dereference() and check for NULL, bailing to the appropriate error or requeue path: encode_cb_sequence4args(), decode_cb_sequence4resok(), nfsd41_cb_get_slot(), nfsd41_cb_release_slot(), nfsd4_cb_prepare(), and nfsd4_cb_sequence_done(). - Switch __free_session() from kfree() to kfree_rcu() so the session slab is not reclaimed until after an RCU grace period, guaranteeing that rpciod readers inside rcu_read_lock() never dereference freed memory. - Pass the session pointer to the nfsd_cb_seq_status and nfsd_cb_free_slot tracepoints instead of having them re-read cl_cb_session. - nfsd4_cb_prepare() calls rpc_exit() when the session is NULL, routing through the done/release path to requeue the callback. The Linux kernel CVE team has assigned CVE-2026-89708 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.38 with commit dcbeaa68dbbdacbbb330a86c7fc95a28473fc209 and fixed in 6.18.50 with commit f164eb52b6f3cbf40f07fe379f9f421f88e02f76 Issue introduced in 2.6.38 with commit dcbeaa68dbbdacbbb330a86c7fc95a28473fc209 and fixed in 7.2.4 with commit 13bdd486c3aad4fc19e6d8b9c3556a4b4c190b25 Issue introduced in 2.6.38 with commit dcbeaa68dbbdacbbb330a86c7fc95a28473fc209 and fixed in 7.3-rc1 with commit 01c5d5f58a5db9b0ee5afba2e49d3157788687b2 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-89708 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/nfsd/nfs4callback.c fs/nfsd/nfs4state.c fs/nfsd/state.h fs/nfsd/trace.h Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/f164eb52b6f3cbf40f07fe379f9f421f88e02f76 https://git.kernel.org/stable/c/13bdd486c3aad4fc19e6d8b9c3556a4b4c190b25 https://git.kernel.org/stable/c/01c5d5f58a5db9b0ee5afba2e49d3157788687b2