NFSv4: remove callback IDR entry on client allocation failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f4eecd5da3422e82e88e36c33cbd2595eebcacb1 · < 3f2387e8bfbc4efda5d77c3a11a028d0a119c48f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
NFSv4: remove callback IDR entry on client allocation failure
nfs4_alloc_client() allocates an NFSv4.0 callback identifier before it finishes setting up the client. If any later initialization step fails, the error path frees the nfs_client directly with nfs_free_client(). That bypasses nfs_put_client(), which is where the callback IDR entry is removed during normal teardown.
A failed allocation can therefore leave cb_ident_idr pointing at a freed nfs_client. A later NFSv4.0 callback lookup by cb_ident would find the stale pointer and take a reference to it.
Make the callback IDR removal helper callable by the allocation failure path, and remove the callback identifier before freeing the client.
This was found by a local static-analysis checker for publish-before-free lifetime bugs and confirmed by manual inspection.
From the CVE record · Linux
An NFSv4.0 client initialization failure can leave a callback identifier pointing to a freed client. A later callback lookup can reference that freed client; the input does not establish whether an attacker can trigger the failure or lookup, or whether authentication or user interaction is required.
Engineers running Linux kernels with NFSv4.0 support should check their exposure; affected versions are not specified.