Skip to contentSkip to conversation

CVE-2026-90037: NFSD: Prevent client use-after-free during close_lru reaping

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 16

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

NFSD: Prevent client use-after-free during close_lru reaping

An nfs4_openowner left on nn->close_lru after its final CLOSE keeps its last closed stateid in oo_last_closed_stid, holding only a raw pointer to its nfs4_client. The laundromat reaps timed-out entries, drops nn->client_lock, and calls nfs4_put_stid(), which dereferences the client through cl_lock. Nothing pins the client across that window, so a concurrent force_expire_client() can free it and nfs4_put_stid() reads freed memory. __destroy_client() hits the same race, walking clp->cl_openowners without cl_lock.

Pin the client with cl_rpc_users before dropping client_lock, and skip clients already expiring. __destroy_client() then cleans up its own close_lru entries through release_last_closed_stateid(), so teardown no longer races the laundromat.

The Linux kernel CVE team has assigned CVE-2026-90037 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 3.17 with commit 217526e7ecc9f6f243e976772e81eab7ab986a4c and fixed in 6.18.51 with commit 83dd59ac1c3455c2c7d8ddb582d980a13199b9b3
	Issue introduced in 3.17 with commit 217526e7ecc9f6f243e976772e81eab7ab986a4c and fixed in 7.2.5 with commit e57a9ed34ea8c17e831de59b8f1a6b2d80d347a1
	Issue introduced in 3.17 with commit 217526e7ecc9f6f243e976772e81eab7ab986a4c and fixed in 7.3-rc1 with commit 2330b788d732f43668b965b3105b37ceb276dfea

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-90037

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/nfs4state.c

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/83dd59ac1c3455c2c7d8ddb582d980a13199b9b3
	https://git.kernel.org/stable/c/e57a9ed34ea8c17e831de59b8f1a6b2d80d347a1
	https://git.kernel.org/stable/c/2330b788d732f43668b965b3105b37ceb276dfea