KernelScan.io

CRITICAL Introduced in 4.8

nfsd LayoutGet OOB

CVE-2026-89674

CVSS 9.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI8.7HIGH

01

In the Linux kernel, the following vulnerability has been resolved: nfsd: fix XDR length calculation in nfsd4_ff_encode_layoutget The XDR buffer size calculation in nfsd4_ff_encode_layoutget() has multiple errors that can result in either an out-of-bounds write or leaking uninitialized kernel memory to the client: - fh_len doesn't account for XDR padding on the file handle data - uid and gid lengths use "8 + len" but xdr_encode_opaque() actually writes "4 + xdr_align_size(len)" bytes - ds_len omits the flags and stats_collect_hint fields (8 bytes), while len's header constant overestimates by 8 bytes -- these partially cancel but leave a net mismatch The worst case occurs with short strings (e.g. uid=0, gid=0 with an odd-sized file handle), where the function writes up to 5 bytes past the reserved XDR buffer. Conversely, when string lengths happen to be 4-byte aligned, the reservation is too large and stale buffer content is sent to the client. Fix this by breaking out every encoded field explicitly in the ds_len calculation, using xdr_align_size() for all variable-length opaque fields, and correcting the header constants.

02

Engine v0.6.0

Risk summary

An NFS server with pNFS flex file exports enabled can be exploited by any network client with access to the export. The client can trigger an out-of-bounds heap write or cause uninitialized kernel memory to be leaked back to the client, potentially leading to kernel crashes or information disclosure.

Affectedfs/nfsd/flexfilelayoutxdr.c (nfsd)

Vulnerability analysis

The NFS server's pNFS flex file layout XDR encoder miscalculates the buffer size needed for the layout response, failing to account for XDR padding on variable-length opaque fields such as file handles and user/group name strings. When the calculated size is too small — typically with short strings and an odd-sized file handle — the encoder writes a few bytes past the reserved buffer into adjacent heap memory. When the calculated size is too large, stale uninitialized kernel memory from the buffer is included in the response sent to the client. The fix corrects the calculation by breaking out every encoded field explicitly and applying proper XDR alignment to all variable-length opaque data. The vulnerable path is reached when any NFS client issues a LAYOUTGET request against an export with pNFS flex files enabled; no special privileges are needed beyond access to the export.

03

BranchIntroducedFixed inPatch commit
5.104.85.10.2703a7fd224df0f
5.154.85.15.22129e4478e2ed5
6.14.86.1.18865a72b721943
6.184.86.18.500380129b1373
mainline4.87.3-rc1f9868174af49
6.64.86.6.157bee826c00ac9
7.24.87.2.4c81cef6a805d
6.124.86.12.109e7d9d23ecd91
cip/6.124.86.12.111-cip32e7d9d23ecd91