cve-2024-56740
Vulnerability from cvelistv5
Published
2024-12-29 11:30
Modified
2025-01-20 06:27
Severity ?
Summary
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.
Impacted products
Vendor Product Version
Linux Linux Version: 70ba381e1a431245c137ed597ec6a05991c79bd9
Version: 70ba381e1a431245c137ed597ec6a05991c79bd9
Create a notification for this product.
   Linux Linux Version: 6.12
Create a notification for this product.
Show details on NVD website


{
   containers: {
      cna: {
         affected: [
            {
               defaultStatus: "unaffected",
               product: "Linux",
               programFiles: [
                  "fs/nfs/localio.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     lessThan: "de5dac261eeab99762bbdf7c20cee5d26ef4462e",
                     status: "affected",
                     version: "70ba381e1a431245c137ed597ec6a05991c79bd9",
                     versionType: "git",
                  },
                  {
                     lessThan: "650703bc4ed3edf841e851c99ab8e7ba9e5262a3",
                     status: "affected",
                     version: "70ba381e1a431245c137ed597ec6a05991c79bd9",
                     versionType: "git",
                  },
               ],
            },
            {
               defaultStatus: "affected",
               product: "Linux",
               programFiles: [
                  "fs/nfs/localio.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     status: "affected",
                     version: "6.12",
                  },
                  {
                     lessThan: "6.12",
                     status: "unaffected",
                     version: "0",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.12.*",
                     status: "unaffected",
                     version: "6.12.2",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "*",
                     status: "unaffected",
                     version: "6.13",
                     versionType: "original_commit_for_fix",
                  },
               ],
            },
         ],
         descriptions: [
            {
               lang: "en",
               value: "In the Linux kernel, the following vulnerability has been resolved:\n\nnfs/localio: must clear res.replen in nfs_local_read_done\n\nOtherwise memory corruption can occur due to NFSv3 LOCALIO reads\nleaving garbage in res.replen:\n- nfs3_read_done() copies that into server->read_hdrsize; from there\n  nfs3_proc_read_setup() copies it to args.replen in new requests.\n- nfs3_xdr_enc_read3args() passes that to rpc_prepare_reply_pages()\n  which includes it in hdrsize for xdr_init_pages, so that rq_rcv_buf\n  contains a ridiculous len.\n- This is copied to rq_private_buf and xs_read_stream_request()\n  eventually passes the kvec to sock_recvmsg() which receives incoming\n  data into entirely the wrong place.\n\nThis is easily reproduced with NFSv3 LOCALIO that is servicing reads\nwhen it is made to pivot back to using normal RPC.  This switch back\nto using normal NFSv3 with RPC can occur for a few reasons but this\nissue was exposed with a test that stops and then restarts the NFSv3\nserver while LOCALIO is performing heavy read IO.",
            },
         ],
         providerMetadata: {
            dateUpdated: "2025-01-20T06:27:10.487Z",
            orgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            shortName: "Linux",
         },
         references: [
            {
               url: "https://git.kernel.org/stable/c/de5dac261eeab99762bbdf7c20cee5d26ef4462e",
            },
            {
               url: "https://git.kernel.org/stable/c/650703bc4ed3edf841e851c99ab8e7ba9e5262a3",
            },
         ],
         title: "nfs/localio: must clear res.replen in nfs_local_read_done",
         x_generator: {
            engine: "bippy-5f407fcff5a0",
         },
      },
   },
   cveMetadata: {
      assignerOrgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      assignerShortName: "Linux",
      cveId: "CVE-2024-56740",
      datePublished: "2024-12-29T11:30:09.180Z",
      dateReserved: "2024-12-29T11:26:39.757Z",
      dateUpdated: "2025-01-20T06:27:10.487Z",
      state: "PUBLISHED",
   },
   dataType: "CVE_RECORD",
   dataVersion: "5.1",
   "vulnerability-lookup:meta": {
      nvd: "{\"cve\":{\"id\":\"CVE-2024-56740\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-12-29T12:15:07.360\",\"lastModified\":\"2025-01-07T22:24:05.593\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnfs/localio: must clear res.replen in nfs_local_read_done\\n\\nOtherwise memory corruption can occur due to NFSv3 LOCALIO reads\\nleaving garbage in res.replen:\\n- nfs3_read_done() copies that into server->read_hdrsize; from there\\n  nfs3_proc_read_setup() copies it to args.replen in new requests.\\n- nfs3_xdr_enc_read3args() passes that to rpc_prepare_reply_pages()\\n  which includes it in hdrsize for xdr_init_pages, so that rq_rcv_buf\\n  contains a ridiculous len.\\n- This is copied to rq_private_buf and xs_read_stream_request()\\n  eventually passes the kvec to sock_recvmsg() which receives incoming\\n  data into entirely the wrong place.\\n\\nThis is easily reproduced with NFSv3 LOCALIO that is servicing reads\\nwhen it is made to pivot back to using normal RPC.  This switch back\\nto using normal NFSv3 with RPC can occur for a few reasons but this\\nissue was exposed with a test that stops and then restarts the NFSv3\\nserver while LOCALIO is performing heavy read IO.\"},{\"lang\":\"es\",\"value\":\"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.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-787\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.12\",\"versionEndExcluding\":\"6.12.2\",\"matchCriteriaId\":\"D8882B1B-2ABC-4838-AC1D-DBDBB5764776\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/650703bc4ed3edf841e851c99ab8e7ba9e5262a3\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/de5dac261eeab99762bbdf7c20cee5d26ef4462e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
   },
}


Log in or create an account to share your comment.

Security Advisory comment format.

This schema specifies the format of a comment related to a security advisory.

UUIDv4 of the comment
UUIDv4 of the Vulnerability-Lookup instance
When the comment was created originally
When the comment was last updated
Title of the comment
Description of the comment
The identifier of the vulnerability (CVE ID, GHSA-ID, PYSEC ID, etc.).



Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.