CVE-2026-31402: nfsd: fix heap overflow in NFSv4.0 LOCK replay cache
In the Linux kernel, the following vulnerability has been resolved:
nfsd: fix heap overflow in NFSv4.0 LOCK replay cache
The NFSv4.0 replay cache uses a fixed 112-byte inline buffer
(rp_ibuf[NFSD4_REPLAY_ISIZE]) to store encoded operation responses.
This size was calculated based on OPEN responses and does not account
for LOCK denied responses, which include the conflicting lock owner as
a variable-length field up to 1024 bytes (NFS4_OPAQUE_LIMIT).
When a LOCK operation is denied due to a conflict with an existing lock
that has a large owner, nfsd4_encode_operation() copies the full encoded
response into the undersized replay buffer via read_bytes_from_xdr_buf()
with no bounds check. This results in a slab-out-of-bounds write of up
to 944 bytes past the end of the buffer, corrupting adjacent heap memory.
This can be triggered remotely by an unauthenticated attacker with two
cooperating NFSv4.0 clients: one sets a lock with a large owner string,
then the other requests a conflicting lock to provoke the denial.
We could fix this by increasing NFSD4_REPLAY_ISIZE to allow for a full
opaque, but that would increase the size of every stateowner, when most
lockowners are not that large.
Instead, fix this by checking the encoded response length against
NFSD4_REPLAY_ISIZE before copying into the replay buffer. If the
response is too large, set rp_buflen to 0 to skip caching the replay
payload. The status is still cached, and the client already received the
correct response on the original request.
Security readout for executives and security teams
Plain-English summary
A remote, unauthenticated attacker who can reach a Linux NFSv4.0 server may trigger kernel heap corruption through conflicting file-lock requests. Because the flaw occurs inside the kernel, consequences could affect system confidentiality, integrity, and availability. Exposure is limited to systems providing reachable NFSv4.0 service, not Linux hosts generally.
Executive priority
Treat reachable NFSv4.0 servers as urgent patching targets because the flaw is remotely triggerable, requires no authentication, and corrupts kernel memory. Prioritize externally reachable and shared infrastructure first. Systems without active NFSv4.0 service are not the immediate focus, but inventories should confirm that assumption.
Technical view
NFSv4.0 LOCK denial responses can contain a lock-owner field substantially larger than the replay cache’s fixed 112-byte inline buffer. The kernel copied the encoded response without checking its length, permitting a slab out-of-bounds write of up to 944 bytes. The fix skips replay-payload caching when the response exceeds the buffer while retaining the status.
Likely exposure
Highest exposure is on Linux systems running the kernel NFS server, accepting NFSv4.0, and reachable by untrusted or broadly connected clients. Distribution kernels may backport fixes, so the supplied upstream version list alone is insufficient for determining whether a specific installed package is vulnerable.
Exploitation context
The source describes remote, unauthenticated triggering using two cooperating NFSv4.0 clients that create conflicting locks. No user interaction or privileges are required. The supplied bundle says this CVE is not in KEV and provides no evidence of active exploitation or a public exploit.
Researcher notes
The vulnerable path copies a variable-length LOCK denial response into rp_ibuf without a bounds check. The correction checks the encoded length against NFSD4_REPLAY_ISIZE; oversized payloads receive rp_buflen zero, while status caching and the original response remain intact. The sources establish memory corruption, but do not document observed exploitation or a demonstrated post-corruption outcome.
Mitigation direction
Inventory hosts providing NFSv4.0 and prioritize those reachable from untrusted or broad internal networks.
Apply the vendor kernel update or stable kernel fix applicable to each deployed kernel branch.
Reboot where required, then verify the running kernel is the updated build.
Until patched, restrict NFS access to explicitly trusted clients and follow distribution-specific guidance.
Validation and detection
Confirm whether each Linux host runs the NFS server and accepts NFSv4.0 connections.
Compare the running kernel package and build against the relevant vendor advisory or stable fix.
Verify the patched kernel is active after maintenance, not merely installed.
Review kernel logs and monitoring for memory-corruption or nfsd crash indicators.
Test NFS locking and replay behavior in a non-production environment after updating.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-787: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
38Source links
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-787 · source CWE mapping
Out-of-bounds Write
Out-of-bounds Write represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.