Linux
SUNRPC: Bound-check xdr_buf_to_bvec() stores before writing
In the Linux kernel, the following vulnerability has been resolved: SUNRPC: Bound-check xdr_buf_to_bvec() stores before writing xdr_buf_to_bvec() writes a bio_vec into the caller's array before testing whether that slot is in range, and the head branch performs the store with no check at all. When the caller's budget is exactly used up, the next store lands one element past the end of the array. The overflow label returns count - 1, which masks the surplus store but cannot undo it. rq_bvec, the array passed by nfsd_vfs_write(), is allocated to exactly rq_maxpages entries with no slack. The OOB store can land in adjacent slab memory; the bv_len and bv_offset fields written there are derived from client-supplied RPC payload sizes. Move the in-range check ahead of the store in the head, page-loop, and tail branches. With the check at the top of each sequence, count is incremented only after a successful store, so the overflow label can return count directly.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 2eb2b93581813b74c7174961126f6ec38eadb5a7, < 4a1148f2739d5089c3ca8ae2e9d1053e219ab5df
- >= 2eb2b93581813b74c7174961126f6ec38eadb5a7, < 6029e711a818bf34d6c4b90cafee24f3afffa110
- >= 2eb2b93581813b74c7174961126f6ec38eadb5a7, < 69e18135e2a004a79505451dbef07314ea16e1eb
- >= 2eb2b93581813b74c7174961126f6ec38eadb5a7, < 98414b42530af65cb984ffc12685096a3b5e179a
- >= 2eb2b93581813b74c7174961126f6ec38eadb5a7, < 42f5b80dda6b86e424054baf1475df686c403d5c
Fixed in 4a1148f2739d5089c3ca8ae2e9d1053e219ab5df, 6029e711a818bf34d6c4b90cafee24f3afffa110, 69e18135e2a004a79505451dbef07314ea16e1eb, 98414b42530af65cb984ffc12685096a3b5e179a, 42f5b80dda6b86e424054baf1475df686c403d5c
- 6.6
Fixed in 0, 6.6.145, 6.12.97, 6.18.40, 7.1.5, 7.2
Mitigation
Upgrade Linux to 4a1148f2739d5089c3ca8ae2e9d1053e219ab5df or 6029e711a818bf34d6c4b90cafee24f3afffa110 or 69e18135e2a004a79505451dbef07314ea16e1eb or 98414b42530af65cb984ffc12685096a3b5e179a or 42f5b80dda6b86e424054baf1475df686c403d5c or later.
Upgrade Linux to 0 or 6.6.145 or 6.12.97 or 6.18.40 or 7.1.5 or 7.2 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.