NFSv4/pnfs: key the data server cache on the NFS version
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d67ae825a59d639e4d8b82413af84d854617a87e · < 27f640cd92eebf5c2f64336be7ca24f4636390cb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
NFSv4/pnfs: key the data server cache on the NFS version
nfs4_pnfs_ds_add() keys the per-net data server cache on the multipath address set alone, and struct nfs4_pnfs_ds records no version. That suffices for the files layout driver, which always connects with version 4, but flexfiles takes its version tuple from GETDEVICEINFO per device, and one address can legitimately serve both NFSv3 and NFSv4.
Two deviceids on one address with different ds_versions[0].version therefore share a single nfs4_pnfs_ds, and whichever mirror connects first pins ds_clp to its own version. The other one is handed that client anyway, so it selects rpc_call_ops for a version the connection does not speak, and the mismatched sequence-slot handling dereferences NULL.
Add the version to the cache key so the two cannot alias, giving each version its own nfs4_pnfs_ds and connection while both mirrors stay usable. Only the major version is compared, since that is what selects rpc_call_ops and rpc_ops; v4.0 and v4.1 keep sharing a client. The files layout driver passes the 4 it already hardcodes at connect time.
From the CVE record · Linux
The Linux kernel’s pNFS data server cache can share a client between two flexfiles device IDs on the same address that use different NFS major versions. If one mirror connects first, the other can use a client for the wrong version, causing a NULL dereference. The input does not specify attacker access or user-interaction requirements.
Engineers running Linux kernels that use the NFSv4/pNFS flexfiles layout should check whether their kernel includes the fix; affected versions are not specified.