HIGH Introduced in 5.13
nfs pnfs LayoutSeg Leak
CVE-2026-89710
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: NFSv4.1: fix layout segment leak on the pnfs_layout_process() forget path When the server returns a new layout stateid while a valid one is still held, pnfs_layout_process() calls pnfs_mark_matching_lsegs_return() on the on-stack free_me list and jumps to out_forget. Segments whose reference count drops to zero are unlinked from lo->plh_segs and moved to free_me by mark_lseg_invalid(); for an idle cached segment the layout header holds the only reference, so this happens on the first decrement. out_forget never drains free_me -- only the success path calls pnfs_free_lseg_list(). Commit 814b84971388 ("pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process()") added the drain; commit 08bd8dbe8882 ("pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process()") removed it while switching the destination to lo->plh_return_segs, which is drained elsewhere. Commit fb700ef02676 ("NFSv4.1: Simplify layout return in pnfs_layout_process()") switched the destination back to free_me without restoring the drain. Restore the pnfs_free_lseg_list() call.
02KernelScan AI Analysis
Risk summary
An NFSv4.1 server returning a new layout stateid while a valid one is still held causes the NFS client to leak layout segments on the forget path. The leaked segments are never freed, and repeated triggering can exhaust client memory. The bug is reachable by any NFSv4.1 client communicating with a malicious or misbehaving server.
Vulnerability analysis
When an NFSv4.1 server returns a new layout stateid while the client still holds a valid one, the client invalidates the old layout segments and moves them onto a local cleanup list, then jumps to an error path that never frees that list. The segments are unlinked from the layout header but their memory is never released, so each occurrence leaks one or more layout segment objects. The fix restores the missing call that drains the cleanup list on the error path, so the segments are freed before returning. The vulnerable path is reached by an NFSv4.1 client processing layout responses from a server, so a malicious or misbehaving NFS server can trigger the leak repeatedly against any client that mounts it.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 5.13 | 6.1.188 | ad3e41855325 |
| 6.6 | 5.13 | 6.6.157 | a080bb69d30f |
| 6.18 | 5.13 | 6.18.50 | 36e3f13bf072 |
| 7.2 | 5.13 | 7.2.4 | 32ac1b0b7f1c |
| 6.12 | 5.13 | 6.12.109 | 7c5b0e813efd |
| mainline | 5.13 | 7.3-rc1 | ee5a386cfe60 |
| 5.15 | 5.13 | 5.15.221 | f52188118d31 |
| cip/6.12 | 5.13 | 6.12.111-cip32 | 7c5b0e813efd |