cve-2024-27036
Vulnerability from cvelistv5
Published
2024-05-01 12:53
Modified
2024-12-19 08:53
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: cifs: Fix writeback data corruption cifs writeback doesn't correctly handle the case where cifs_extend_writeback() hits a point where it is considering an additional folio, but this would overrun the wsize - at which point it drops out of the xarray scanning loop and calls xas_pause(). The problem is that xas_pause() advances the loop counter - thereby skipping that page. What needs to happen is for xas_reset() to be called any time we decide we don't want to process the page we're looking at, but rather send the request we are building and start a new one. Fix this by copying and adapting the netfslib writepages code as a temporary measure, with cifs writeback intending to be offloaded to netfslib in the near future. This also fixes the issue with the use of filemap_get_folios_tag() causing retry of a bunch of pages which the extender already dealt with. This can be tested by creating, say, a 64K file somewhere not on cifs (otherwise copy-offload may get underfoot), mounting a cifs share with a wsize of 64000, copying the file to it and then comparing the original file and the copy: dd if=/dev/urandom of=/tmp/64K bs=64k count=1 mount //192.168.6.1/test /mnt -o user=...,pass=...,wsize=64000 cp /tmp/64K /mnt/64K cmp /tmp/64K /mnt/64K Without the fix, the cmp fails at position 64000 (or shortly thereafter).
Impacted products
Vendor Product Version
Linux Linux Version: 6.3
Show details on NVD website


{
   containers: {
      adp: [
         {
            metrics: [
               {
                  other: {
                     content: {
                        id: "CVE-2024-27036",
                        options: [
                           {
                              Exploitation: "none",
                           },
                           {
                              Automatable: "no",
                           },
                           {
                              "Technical Impact": "partial",
                           },
                        ],
                        role: "CISA Coordinator",
                        timestamp: "2024-05-28T16:19:34.397708Z",
                        version: "2.0.3",
                     },
                     type: "ssvc",
                  },
               },
            ],
            providerMetadata: {
               dateUpdated: "2024-06-04T17:47:15.864Z",
               orgId: "134c704f-9b21-4f2e-91b3-4a467353bcc0",
               shortName: "CISA-ADP",
            },
            title: "CISA ADP Vulnrichment",
         },
         {
            providerMetadata: {
               dateUpdated: "2024-08-02T00:21:05.930Z",
               orgId: "af854a3a-2127-422b-91ae-364da2661108",
               shortName: "CVE",
            },
            references: [
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/e45deec35bf7f1f4f992a707b2d04a8c162f2240",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/65f2ced695982ccd516196d0a9447d85dbe2eed5",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/844b4e132f57f1333dc79feaa035075a096762e4",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/f3dc1bdb6b0b0693562c7c54a6c28bafa608ba3c",
               },
            ],
            title: "CVE Program Container",
         },
      ],
      cna: {
         affected: [
            {
               defaultStatus: "unaffected",
               product: "Linux",
               programFiles: [
                  "fs/smb/client/file.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     lessThan: "e45deec35bf7f1f4f992a707b2d04a8c162f2240",
                     status: "affected",
                     version: "d08089f649a0cfb2099c8551ac47eef0cc23fdf2",
                     versionType: "git",
                  },
                  {
                     lessThan: "65f2ced695982ccd516196d0a9447d85dbe2eed5",
                     status: "affected",
                     version: "d08089f649a0cfb2099c8551ac47eef0cc23fdf2",
                     versionType: "git",
                  },
                  {
                     lessThan: "844b4e132f57f1333dc79feaa035075a096762e4",
                     status: "affected",
                     version: "d08089f649a0cfb2099c8551ac47eef0cc23fdf2",
                     versionType: "git",
                  },
                  {
                     lessThan: "f3dc1bdb6b0b0693562c7c54a6c28bafa608ba3c",
                     status: "affected",
                     version: "d08089f649a0cfb2099c8551ac47eef0cc23fdf2",
                     versionType: "git",
                  },
               ],
            },
            {
               defaultStatus: "affected",
               product: "Linux",
               programFiles: [
                  "fs/smb/client/file.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     status: "affected",
                     version: "6.3",
                  },
                  {
                     lessThan: "6.3",
                     status: "unaffected",
                     version: "0",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.6.*",
                     status: "unaffected",
                     version: "6.6.23",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.7.*",
                     status: "unaffected",
                     version: "6.7.11",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.8.*",
                     status: "unaffected",
                     version: "6.8.2",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "*",
                     status: "unaffected",
                     version: "6.9",
                     versionType: "original_commit_for_fix",
                  },
               ],
            },
         ],
         descriptions: [
            {
               lang: "en",
               value: "In the Linux kernel, the following vulnerability has been resolved:\n\ncifs: Fix writeback data corruption\n\ncifs writeback doesn't correctly handle the case where\ncifs_extend_writeback() hits a point where it is considering an additional\nfolio, but this would overrun the wsize - at which point it drops out of\nthe xarray scanning loop and calls xas_pause().  The problem is that\nxas_pause() advances the loop counter - thereby skipping that page.\n\nWhat needs to happen is for xas_reset() to be called any time we decide we\ndon't want to process the page we're looking at, but rather send the\nrequest we are building and start a new one.\n\nFix this by copying and adapting the netfslib writepages code as a\ntemporary measure, with cifs writeback intending to be offloaded to\nnetfslib in the near future.\n\nThis also fixes the issue with the use of filemap_get_folios_tag() causing\nretry of a bunch of pages which the extender already dealt with.\n\nThis can be tested by creating, say, a 64K file somewhere not on cifs\n(otherwise copy-offload may get underfoot), mounting a cifs share with a\nwsize of 64000, copying the file to it and then comparing the original file\nand the copy:\n\n        dd if=/dev/urandom of=/tmp/64K bs=64k count=1\n        mount //192.168.6.1/test /mnt -o user=...,pass=...,wsize=64000\n        cp /tmp/64K /mnt/64K\n        cmp /tmp/64K /mnt/64K\n\nWithout the fix, the cmp fails at position 64000 (or shortly thereafter).",
            },
         ],
         providerMetadata: {
            dateUpdated: "2024-12-19T08:53:05.128Z",
            orgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            shortName: "Linux",
         },
         references: [
            {
               url: "https://git.kernel.org/stable/c/e45deec35bf7f1f4f992a707b2d04a8c162f2240",
            },
            {
               url: "https://git.kernel.org/stable/c/65f2ced695982ccd516196d0a9447d85dbe2eed5",
            },
            {
               url: "https://git.kernel.org/stable/c/844b4e132f57f1333dc79feaa035075a096762e4",
            },
            {
               url: "https://git.kernel.org/stable/c/f3dc1bdb6b0b0693562c7c54a6c28bafa608ba3c",
            },
         ],
         title: "cifs: Fix writeback data corruption",
         x_generator: {
            engine: "bippy-5f407fcff5a0",
         },
      },
   },
   cveMetadata: {
      assignerOrgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      assignerShortName: "Linux",
      cveId: "CVE-2024-27036",
      datePublished: "2024-05-01T12:53:46.721Z",
      dateReserved: "2024-02-19T14:20:24.211Z",
      dateUpdated: "2024-12-19T08:53:05.128Z",
      state: "PUBLISHED",
   },
   dataType: "CVE_RECORD",
   dataVersion: "5.1",
   "vulnerability-lookup:meta": {
      nvd: "{\"cve\":{\"id\":\"CVE-2024-27036\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-01T13:15:49.407\",\"lastModified\":\"2024-11-21T09:03:42.940\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ncifs: Fix writeback data corruption\\n\\ncifs writeback doesn't correctly handle the case where\\ncifs_extend_writeback() hits a point where it is considering an additional\\nfolio, but this would overrun the wsize - at which point it drops out of\\nthe xarray scanning loop and calls xas_pause().  The problem is that\\nxas_pause() advances the loop counter - thereby skipping that page.\\n\\nWhat needs to happen is for xas_reset() to be called any time we decide we\\ndon't want to process the page we're looking at, but rather send the\\nrequest we are building and start a new one.\\n\\nFix this by copying and adapting the netfslib writepages code as a\\ntemporary measure, with cifs writeback intending to be offloaded to\\nnetfslib in the near future.\\n\\nThis also fixes the issue with the use of filemap_get_folios_tag() causing\\nretry of a bunch of pages which the extender already dealt with.\\n\\nThis can be tested by creating, say, a 64K file somewhere not on cifs\\n(otherwise copy-offload may get underfoot), mounting a cifs share with a\\nwsize of 64000, copying the file to it and then comparing the original file\\nand the copy:\\n\\n        dd if=/dev/urandom of=/tmp/64K bs=64k count=1\\n        mount //192.168.6.1/test /mnt -o user=...,pass=...,wsize=64000\\n        cp /tmp/64K /mnt/64K\\n        cmp /tmp/64K /mnt/64K\\n\\nWithout the fix, the cmp fails at position 64000 (or shortly thereafter).\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvió la siguiente vulnerabilidad: cifs: corrige la corrupción de datos de reescritura cifs writeback no maneja correctamente el caso en el que cifs_extend_writeback() llega a un punto en el que está considerando una publicación adicional, pero esto sobrepasaría el tamaño de wsize - en momento en el que sale del ciclo de escaneo de xarray y llama a xas_pause(). El problema es que xas_pause() avanza el contador de bucle, omitiendo así esa página. Lo que debe suceder es que se llame a xas_reset() cada vez que decidamos que no queremos procesar la página que estamos viendo, sino enviar la solicitud que estamos creando y comenzar una nueva. Solucione este problema copiando y adaptando el código de escritura de netfslib como medida temporal, y la escritura diferida de cifs se descargará a netfslib en un futuro próximo. Esto también soluciona el problema con el uso de filemap_get_folios_tag() que provocaba un reintento de un grupo de páginas que el extensor ya había tratado. Esto se puede probar creando, por ejemplo, un archivo de 64 K en algún lugar que no esté en cif (de lo contrario, la descarga de copia podría complicarse), montando un recurso compartido cif con un tamaño de 64000, copiando el archivo en él y luego comparando el archivo original y la copia. : dd if=/dev/urandom of=/tmp/64K bs=64k count=1 mount //192.168.6.1/test /mnt -o user=...,pass=...,wsize=64000 cp /tmp /64K /mnt/64K cmp /tmp/64K /mnt/64K Sin la corrección, el cmp falla en la posición 64000 (o poco después).\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/65f2ced695982ccd516196d0a9447d85dbe2eed5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/844b4e132f57f1333dc79feaa035075a096762e4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e45deec35bf7f1f4f992a707b2d04a8c162f2240\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f3dc1bdb6b0b0693562c7c54a6c28bafa608ba3c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/65f2ced695982ccd516196d0a9447d85dbe2eed5\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/844b4e132f57f1333dc79feaa035075a096762e4\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/e45deec35bf7f1f4f992a707b2d04a8c162f2240\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/f3dc1bdb6b0b0693562c7c54a6c28bafa608ba3c\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}",
   },
}


Log in or create an account to share your comment.




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.