Sceawere
Vulnerability Detail
CVE-2026-89713UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
NFSD TOCTOU Truncation Permission Bypass
Vulnerability Metadata
- Severity
- Critical
- Score / CVSS
- 9.1
- Creation Date
- 1d ago
- Vendor
- Linux
- Product
- Linux
- Attack Type
- N/A
- Vector String
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
- Attack Complexity
- LOW
Narrative and Response
Description
In the Linux kernel, the following vulnerability has been resolved: NFSD: check truncate permission under inode lock nfsd_setattr() checks whether a size update needs NFSD_MAY_TRUNC before it takes inode_lock(). The comparison uses the file size sampled by that unlocked read, but the actual ATTR_SIZE update is applied later under inode_lock() by notify_change(). This leaves a TOCTOU window for append-only files. If a client sends a SETATTR that does not shrink the file at the time of the unlocked sample, a concurrent append can extend the file before nfsd_setattr() takes inode_lock(). notify_change() then applies a real truncation without the NFSD_MAY_TRUNC check that rejects IS_APPEND(inode). The VFS truncate syscall paths perform their own append-only checks before calling notify_change(), so NFSD must make this decision against the locked size it is about to change. Split the write-count acquisition from the truncation permission check. Keep get_write_access() before the locked setattr work, then recheck whether the requested size is below i_size_read(inode) after inode_lock() has been acquired and before notify_change(ATTR_SIZE). This also avoids the plain unlocked inode->i_size load.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "9.1",
"pubDate": "2026-09-11T20:19:58.743Z",
"pubdate": "2026-09-11T20:19:58.743Z",
"executiveSummary": "A Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the Linux kernel's NFSD component during the processing of SETATTR operations.\nThe vulnerability occurs because the NFSD_MAY_TRUNC permission check is performed using an unlocked file size value before acquiring the inode lock.\nAn attacker can exploit this race condition to bypass append-only file restrictions by extending the file after the initial permission check but before the inode is locked.\nThis flaw allows unauthorized truncation of append-only files, potentially compromising data integrity and security policies enforced by the filesystem.\nThe vulnerability affects systems utilizing NFSD to handle file attributes; successful exploitation requires a local or remote user with the ability to issue SETATTR requests to the affected NFS export.\nThe risk is categorized as a security bypass, as the kernel fails to properly enforce mandatory access controls regarding file truncation on constrained files.",
"technicalDetails": "The root cause of this vulnerability lies in an improper sequence of operations within nfsd_setattr(). The function historically performed a check for NFSD_MAY_TRUNC based on a cached or unlocked sample of the file size (i_size) retrieved before the inode_lock() was acquired.\nBecause the final size change is applied by notify_change() only after the inode lock is taken, a TOCTOU window is opened between the check and the actual mutation.\nAn attacker can exploit this window by monitoring or timing a SETATTR operation. Specifically, if a client sends a SETATTR request that does not trigger a truncation (size >= current size) at the time of the initial check, the check passes. If the attacker then performs a concurrent append operation to extend the file before nfsd_setattr() reaches the notify_change() call, the actual size applied by the kernel will result in a truncation relative to the new, extended size.\nThis circumvents the IS_APPEND(inode) protection check, which is designed to prevent modifications to files flagged with the append-only attribute. In standard VFS syscall paths, append-only checks are performed in conjunction with lock acquisition, ensuring the state cannot change between validation and execution.\nBy failing to re-verify the necessity of the truncation check after acquiring the inode lock, NFSD allows the notify_change() function to proceed with an operation that would otherwise be rejected by the VFS append-only constraint.\nThe patch resolves this by decoupling write-count acquisition from the permission logic. The NFSD_MAY_TRUNC decision is deferred until after the inode_lock() has been acquired, ensuring that the size comparison is performed against a stable, locked representation of the inode's current size. This eliminates the race condition by ensuring the check and the mutation are atomic relative to the state of the inode."
}