nfsd: fix BUG_ON in nfsd4_alloc_layout_stateid on racing delegation revoke
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c5c707f96fc9a6e5a57ca5baac892673270abe3d · < ca94ba36172046be6a694a7986f6931e47ed4d51| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfsd: fix BUG_ON in nfsd4_alloc_layout_stateid on racing delegation revoke
nfsd4_alloc_layout_stateid reads fp->fi_deleg_file without holding fi_lock when the parent stateid is a delegation. A concurrent delegation revoke via the laundromat can clear fi_deleg_file under fi_lock, causing nfsd_file_get() to return NULL and triggering the BUG_ON.
This race is client-reachable: two NFS clients can trigger it by having one hold a delegation while another opens the same file to force a recall. When the first client doesn't respond to the recall, the laundromat revokes it. A concurrent LAYOUTGET from any client using the delegation stateid hits the race window.
Fix this by taking fi_lock around the fi_deleg_file read in the SC_TYPE_DELEG path, matching the locking discipline of the find_any_file() arm, and replacing the BUG_ON with a graceful error return that cleans up the partially-initialized layout stateid.
From the CVE record · Linux
A race in the Linux kernel's nfsd can trigger a BUG_ON when a delegation is revoked during layout stateid allocation. Two NFS clients can create the conditions by forcing a delegation recall that goes unanswered; a concurrent LAYOUTGET using the delegation stateid can then hit the race. The issue is reachable by NFS clients, and the input does not specify authentication requirements.
Administrators running Linux kernel NFS servers should check their kernel versions; affected versions are not specified.