In the Linux kernel, the following vulnerability has been resolved:
nfs/localio: must clear res.replen in nfs_local_read_done
Otherwise memory corruption can occur due to NFSv3 LOCALIO reads leaving garbage in res.replen:
- nfs3_read_done() copies that into server->read_hdrsize; from there
- nfs3_xdr_enc_read3args() passes that to rpc_prepare_reply_pages()
- This is copied to rq_private_buf and xs_read_stream_request()
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.