cve-2024-36001
Vulnerability from cvelistv5
Published
2024-05-20 09:48
Modified
2024-12-19 08:59
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: netfs: Fix the pre-flush when appending to a file in writethrough mode In netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH or O_*SYNC or RWF_*SYNC was specified, write-through caching is performed on a buffered file. When setting up for write-through, we flush any conflicting writes in the region and wait for the write to complete, failing if there's a write error to return. The issue arises if we're writing at or above the EOF position because we skip the flush and - more importantly - the wait. This becomes a problem if there's a partial folio at the end of the file that is being written out and we want to make a write to it too. Both the already-running write and the write we start both want to clear the writeback mark, but whoever is second causes a warning looking something like: ------------[ cut here ]------------ R=00000012: folio 11 is not under writeback WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105 ... CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ... ... Workqueue: events_unbound netfs_write_collection_worker ... RIP: 0010:netfs_writeback_lookup_folio Fix this by making the flush-and-wait unconditional. It will do nothing if there are no folios in the pagecache and will return quickly if there are no folios in the region specified. Further, move the WBC attachment above the flush call as the flush is going to attach a WBC and detach it again if it is not present - and since we need one anyway we might as well share it.
Impacted products
Vendor Product Version
Linux Linux Version: 41d8e7673a7726cba57cb8112d81c89cfb6c3e35
Version: 41d8e7673a7726cba57cb8112d81c89cfb6c3e35
Create a notification for this product.
   Linux Linux Version: 6.8
Create a notification for this product.
Show details on NVD website


{
   containers: {
      adp: [
         {
            metrics: [
               {
                  other: {
                     content: {
                        id: "CVE-2024-36001",
                        options: [
                           {
                              Exploitation: "none",
                           },
                           {
                              Automatable: "no",
                           },
                           {
                              "Technical Impact": "partial",
                           },
                        ],
                        role: "CISA Coordinator",
                        timestamp: "2024-05-20T14:21:51.289020Z",
                        version: "2.0.3",
                     },
                     type: "ssvc",
                  },
               },
            ],
            providerMetadata: {
               dateUpdated: "2024-06-04T17:48:03.177Z",
               orgId: "134c704f-9b21-4f2e-91b3-4a467353bcc0",
               shortName: "CISA-ADP",
            },
            title: "CISA ADP Vulnrichment",
         },
         {
            providerMetadata: {
               dateUpdated: "2024-08-02T03:30:11.620Z",
               orgId: "af854a3a-2127-422b-91ae-364da2661108",
               shortName: "CVE",
            },
            references: [
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5",
               },
            ],
            title: "CVE Program Container",
         },
      ],
      cna: {
         affected: [
            {
               defaultStatus: "unaffected",
               product: "Linux",
               programFiles: [
                  "fs/netfs/buffered_write.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     lessThan: "5eaf23b2e81349f6614f88396dc468fda89fc0b9",
                     status: "affected",
                     version: "41d8e7673a7726cba57cb8112d81c89cfb6c3e35",
                     versionType: "git",
                  },
                  {
                     lessThan: "c97f59e276d4e93480f29a70accbd0d7273cf3f5",
                     status: "affected",
                     version: "41d8e7673a7726cba57cb8112d81c89cfb6c3e35",
                     versionType: "git",
                  },
               ],
            },
            {
               defaultStatus: "affected",
               product: "Linux",
               programFiles: [
                  "fs/netfs/buffered_write.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     status: "affected",
                     version: "6.8",
                  },
                  {
                     lessThan: "6.8",
                     status: "unaffected",
                     version: "0",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.8.*",
                     status: "unaffected",
                     version: "6.8.9",
                     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\nnetfs: Fix the pre-flush when appending to a file in writethrough mode\n\nIn netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH\nor O_*SYNC or RWF_*SYNC was specified, write-through caching is performed\non a buffered file.  When setting up for write-through, we flush any\nconflicting writes in the region and wait for the write to complete,\nfailing if there's a write error to return.\n\nThe issue arises if we're writing at or above the EOF position because we\nskip the flush and - more importantly - the wait.  This becomes a problem\nif there's a partial folio at the end of the file that is being written out\nand we want to make a write to it too.  Both the already-running write and\nthe write we start both want to clear the writeback mark, but whoever is\nsecond causes a warning looking something like:\n\n    ------------[ cut here ]------------\n    R=00000012: folio 11 is not under writeback\n    WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105\n    ...\n    CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ...\n    ...\n    Workqueue: events_unbound netfs_write_collection_worker\n    ...\n    RIP: 0010:netfs_writeback_lookup_folio\n\nFix this by making the flush-and-wait unconditional.  It will do nothing if\nthere are no folios in the pagecache and will return quickly if there are\nno folios in the region specified.\n\nFurther, move the WBC attachment above the flush call as the flush is going\nto attach a WBC and detach it again if it is not present - and since we\nneed one anyway we might as well share it.",
            },
         ],
         providerMetadata: {
            dateUpdated: "2024-12-19T08:59:59.438Z",
            orgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            shortName: "Linux",
         },
         references: [
            {
               url: "https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9",
            },
            {
               url: "https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5",
            },
         ],
         title: "netfs: Fix the pre-flush when appending to a file in writethrough mode",
         x_generator: {
            engine: "bippy-5f407fcff5a0",
         },
      },
   },
   cveMetadata: {
      assignerOrgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      assignerShortName: "Linux",
      cveId: "CVE-2024-36001",
      datePublished: "2024-05-20T09:48:02.966Z",
      dateReserved: "2024-05-17T13:50:33.149Z",
      dateUpdated: "2024-12-19T08:59:59.438Z",
      state: "PUBLISHED",
   },
   dataType: "CVE_RECORD",
   dataVersion: "5.1",
   "vulnerability-lookup:meta": {
      nvd: "{\"cve\":{\"id\":\"CVE-2024-36001\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-20T10:15:14.230\",\"lastModified\":\"2024-11-21T09:21:24.297\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnetfs: Fix the pre-flush when appending to a file in writethrough mode\\n\\nIn netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH\\nor O_*SYNC or RWF_*SYNC was specified, write-through caching is performed\\non a buffered file.  When setting up for write-through, we flush any\\nconflicting writes in the region and wait for the write to complete,\\nfailing if there's a write error to return.\\n\\nThe issue arises if we're writing at or above the EOF position because we\\nskip the flush and - more importantly - the wait.  This becomes a problem\\nif there's a partial folio at the end of the file that is being written out\\nand we want to make a write to it too.  Both the already-running write and\\nthe write we start both want to clear the writeback mark, but whoever is\\nsecond causes a warning looking something like:\\n\\n    ------------[ cut here ]------------\\n    R=00000012: folio 11 is not under writeback\\n    WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105\\n    ...\\n    CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ...\\n    ...\\n    Workqueue: events_unbound netfs_write_collection_worker\\n    ...\\n    RIP: 0010:netfs_writeback_lookup_folio\\n\\nFix this by making the flush-and-wait unconditional.  It will do nothing if\\nthere are no folios in the pagecache and will return quickly if there are\\nno folios in the region specified.\\n\\nFurther, move the WBC attachment above the flush call as the flush is going\\nto attach a WBC and detach it again if it is not present - and since we\\nneed one anyway we might as well share it.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: netfs: soluciona el lavado previo al agregar un archivo en modo de escritura directa. En netfs_perform_write(), cuando se especifica el archivo marcado como NETFS_ICTX_WRITETHROUGH o O_*SYNC o RWF_*SYNC, escriba -El almacenamiento en caché se realiza en un archivo almacenado en búfer. Al configurar la escritura directa, eliminamos cualquier escritura conflictiva en la región y esperamos a que se complete la escritura, fallando si hay un error de escritura que devolver. El problema surge si escribimos en la posición EOF o por encima de ella porque nos saltamos el color y, lo que es más importante, la espera. Esto se convierte en un problema si hay un folio parcial al final del archivo que se está escribiendo y queremos escribir en él también. Tanto la escritura que ya se está ejecutando como la escritura que comenzamos quieren borrar la marca de reescritura, pero quienquiera que esté en segundo lugar genera una advertencia similar a: ------------[cortar aquí]---- -------- R=00000012: el folio 11 no está bajo reescritura ADVERTENCIA: CPU: 34 PID: 654 en fs/netfs/write_collect.c:105 ... CPU: 34 PID: 654 Comm: kworker/u386 :27 Contaminado: GS... ... Cola de trabajo: events_unbound netfs_write_collection_worker... RIP: 0010:netfs_writeback_lookup_folio Solucione este problema haciendo que el lavado y la espera sean incondicionales. No hará nada si no hay publicaciones en el caché de páginas y regresará rápidamente si no hay publicaciones en la región especificada. Además, mueva el archivo adjunto de WBC por encima de la llamada de descarga, ya que la descarga conectará un WBC y lo separará nuevamente si no está presente, y dado que necesitamos uno de todos modos, también podríamos compartirlo.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}",
      vulnrichment: {
         containers: "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T03:30:11.620Z\"}}, {\"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-36001\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-05-20T14:21:51.289020Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-05-23T19:01:24.821Z\"}, \"title\": \"CISA ADP Vulnrichment\"}], \"cna\": {\"title\": \"netfs: Fix the pre-flush when appending to a file in writethrough mode\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"41d8e7673a7726cba57cb8112d81c89cfb6c3e35\", \"lessThan\": \"5eaf23b2e81349f6614f88396dc468fda89fc0b9\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"41d8e7673a7726cba57cb8112d81c89cfb6c3e35\", \"lessThan\": \"c97f59e276d4e93480f29a70accbd0d7273cf3f5\", \"versionType\": \"git\"}], \"programFiles\": [\"fs/netfs/buffered_write.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.8\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.8\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.8.9\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.8.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"fs/netfs/buffered_write.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9\"}, {\"url\": \"https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5\"}], \"x_generator\": {\"engine\": \"bippy-5f407fcff5a0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnetfs: Fix the pre-flush when appending to a file in writethrough mode\\n\\nIn netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH\\nor O_*SYNC or RWF_*SYNC was specified, write-through caching is performed\\non a buffered file.  When setting up for write-through, we flush any\\nconflicting writes in the region and wait for the write to complete,\\nfailing if there's a write error to return.\\n\\nThe issue arises if we're writing at or above the EOF position because we\\nskip the flush and - more importantly - the wait.  This becomes a problem\\nif there's a partial folio at the end of the file that is being written out\\nand we want to make a write to it too.  Both the already-running write and\\nthe write we start both want to clear the writeback mark, but whoever is\\nsecond causes a warning looking something like:\\n\\n    ------------[ cut here ]------------\\n    R=00000012: folio 11 is not under writeback\\n    WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105\\n    ...\\n    CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ...\\n    ...\\n    Workqueue: events_unbound netfs_write_collection_worker\\n    ...\\n    RIP: 0010:netfs_writeback_lookup_folio\\n\\nFix this by making the flush-and-wait unconditional.  It will do nothing if\\nthere are no folios in the pagecache and will return quickly if there are\\nno folios in the region specified.\\n\\nFurther, move the WBC attachment above the flush call as the flush is going\\nto attach a WBC and detach it again if it is not present - and since we\\nneed one anyway we might as well share it.\"}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2024-12-19T08:59:59.438Z\"}}}",
         cveMetadata: "{\"cveId\": \"CVE-2024-36001\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2024-12-19T08:59:59.438Z\", \"dateReserved\": \"2024-05-17T13:50:33.149Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-20T09:48:02.966Z\", \"assignerShortName\": \"Linux\"}",
         dataType: "CVE_RECORD",
         dataVersion: "5.1",
      },
   },
}


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.