In the Linux kernel, the following vulnerability has been resolved:
nfs/localio: must clear res.replen in nfslocalread_done
Otherwise memory corruption can occur due to NFSv3 LOCALIO reads leaving garbage in res.replen: - nfs3readdone() copies that into server->readhdrsize; from there nfs3procreadsetup() copies it to args.replen in new requests. - nfs3xdrencread3args() passes that to rpcpreparereplypages() which includes it in hdrsize for xdrinitpages, so that rqrcvbuf contains a ridiculous len. - This is copied to rqprivatebuf and xsreadstreamrequest() eventually passes the kvec to sockrecvmsg() which receives incoming data into entirely the wrong place.
This is easily reproduced with NFSv3 LOCALIO that is servicing reads when it is made to pivot back to using normal RPC. This switch back to using normal NFSv3 with RPC can occur for a few reasons but this issue was exposed with a test that stops and then restarts the NFSv3 server while LOCALIO is performing heavy read IO.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56740.json"
}