7.8high
nfs/localio: must clear res.replen in nfs_local_read_done
- Severity
- 7.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.20% (higher than 9% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
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_proc_read_setup() copies it to args.replen in new requests. - nfs3_xdr_enc_read3args() passes that to rpc_prepare_reply_pages() which includes it in hdrsize for xdr_init_pages, so that rq_rcv_buf contains a ridiculous len. - This is copied to rq_private_buf and xs_read_stream_request() eventually passes the kvec to sock_recvmsg() 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 70ba381e1a431245c137ed597ec6a05991c79bd9 before de5dac261eeab99762bbdf7c20cee5d26ef4462e, from 70ba381e1a431245c137ed597ec6a05991c79bd9 before 650703bc4ed3edf841e851c99ab8e7ba9e5262a3, 6.12 Not affected: before 6.12, from 6.12.2 up to 6.12.*, from 6.13 up to * | CVE List |
| linux linux_kernel | from 6.12 before 6.12.2 | NVD |
All scores
| Linux | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CISA-ADP | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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_proc_read_setup() copies it to args.replen in new requests. - nfs3_xdr_enc_read3args() passes that to rpc_prepare_reply_pages() which includes it in hdrsize for xdr_init_pages, so that rq_rcv_buf contains a ridiculous len. - This is copied to rq_private_buf and xs_read_stream_request() eventually passes the kvec to sock_recvmsg() 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.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: nfs/localio: debe borrar res.replen en nfs_local_read_done De lo contrario, puede producirse corrupción de memoria debido a que las lecturas LOCALIO de NFSv3 dejan basura en res.replen: - nfs3_read_done() copia eso en server->read_hdrsize; desde allí, nfs3_proc_read_setup() lo copia en args.replen en nuevas solicitudes. - nfs3_xdr_enc_read3args() pasa eso a rpc_prepare_reply_pages() que lo incluye en hdrsize para xdr_init_pages, de modo que rq_rcv_buf contiene una longitud ridícula. - Esto se copia a rq_private_buf y xs_read_stream_request() eventualmente pasa el kvec a sock_recvmsg() que recibe datos entrantes en un lugar completamente equivocado. Esto se reproduce fácilmente con NFSv3 LOCALIO, que está prestando servicio a las lecturas, cuando se le obliga a volver a utilizar RPC normal. Este cambio a utilizar NFSv3 normal con RPC puede ocurrir por varias razones, pero este problema se expuso con una prueba que detiene y luego reinicia el servidor NFSv3 mientras LOCALIO realiza operaciones de E/S de lectura pesadas.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-56740 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2024-56740 changed 2026-06-17 | Public domain |