CRITICAL Introduced in 2.6.18
lockd TraverseFiles UAF
CVE-2026-89485
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI8.1HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: lockd: pin next file across nlm_inspect_file lock-drop nlm_traverse_files() pins the current file with f_count++ across a mutex_unlock for nlm_inspect_file(), but nothing pins the saved next pointer. A concurrent nlm_release_file() can kfree the next file during the unlock window, and the iterator dereferences freed memory on the next loop step. Pin both current and next before the lock-drop. Advance by swapping the pinned cursors at the end of each iteration so next is always held alive across the unlock. Always call nlm_file_release() after dropping the iteration pin, regardless of whether the file matched the predicate. Use nlm_file_inuse(), which does a live walk of the inode lock list, rather than the cached f_locks field, so skipped files that never ran nlm_inspect_file() are evaluated correctly. Because every file in a hash bucket is now pinned and released, files skipped by the is_failover_file predicate that have no locks, blocks, shares, or external references are deleted during traversal. The old code never evaluated skipped files for cleanup. The new behavior is intentional: such files are stale and should not persist in the table.
02KernelScan AI Analysis
Risk summary
Products running an NFS server with lockd are at risk. A remote attacker who can reach the NFS/NLM service can trigger a use-after-free by racing file-release operations against the server's internal file traversal, potentially leading to kernel memory corruption, information disclosure, or a system crash. Exploitation requires precise timing of concurrent NFS lock operations but needs no local access or special privileges.
Vulnerability analysis
The NFS lock manager's file traversal routine drops a mutex to inspect each file but only pins the current file's reference count, leaving the next file in the hash bucket unpinned. A concurrent file-release operation from another NFS client can free that next file during the unlock window, causing the iterator to dereference freed memory on the following loop step. The fix pins both the current and next files before dropping the mutex and advances by swapping the pinned cursors so the next entry is always held alive across the unlock; it also switches to a live lock-list check so skipped files are correctly evaluated for cleanup. This is reachable from any network client that can send NLM lock requests to the server — no local access or special privileges are required beyond reaching the NFS/NLM service, though exploitation requires winning a narrow race window.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 2.6.18 | 5.10.270 | e3c413f789ea |
| 5.15 | 2.6.18 | 5.15.221 | 08a455f87b14 |
| 6.1 | 2.6.18 | 6.1.188 | 550c19222c71 |
| 6.12 | 2.6.18 | 6.12.109 | c24bdb7df2f3 |
| 6.18 | 2.6.18 | 6.18.50 | 41f0a6d31615 |
| 6.6 | 2.6.18 | 6.6.157 | 350087f231c1 |
| 7.2 | 2.6.18 | 7.2.4 | e999a8813365 |
| mainline | 2.6.18 | 7.3 | 526c49cff3f7 |
| cip/5.10 | 2.6.18 | 5.10.271-cip78 | e3c413f789ea |
| cip/6.1 | 2.6.18 | 6.1.189-cip61 | 550c19222c71 |
| cip/6.1-rt | 2.6.18 | 6.1.189-cip61-rt32 | 550c19222c71 |
| cip/6.12 | 2.6.18 | 6.12.111-cip32 | c24bdb7df2f3 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.268-cip77-rt34) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip115) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |