CVE-2024-57952
Vulnerability from cvelistv5
Published
2025-02-12 13:52
Modified
2025-02-13 15:37
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: Revert "libfs: fix infinite directory reads for offset dir" The current directory offset allocator (based on mtree_alloc_cyclic) stores the next offset value to return in octx->next_offset. This mechanism typically returns values that increase monotonically over time. Eventually, though, the newly allocated offset value wraps back to a low number (say, 2) which is smaller than other already- allocated offset values. Yu Kuai <yukuai3@huawei.com> reports that, after commit 64a7ce76fb90 ("libfs: fix infinite directory reads for offset dir"), if a directory's offset allocator wraps, existing entries are no longer visible via readdir/getdents because offset_readdir() stops listing entries once an entry's offset is larger than octx->next_offset. These entries vanish persistently -- they can be looked up, but will never again appear in readdir(3) output. The reason for this is that the commit treats directory offsets as monotonically increasing integer values rather than opaque cookies, and introduces this comparison: if (dentry2offset(dentry) >= last_index) { On 64-bit platforms, the directory offset value upper bound is 2^63 - 1. Directory offsets will monotonically increase for millions of years without wrapping. On 32-bit platforms, however, LONG_MAX is 2^31 - 1. The allocator can wrap after only a few weeks (at worst). Revert commit 64a7ce76fb90 ("libfs: fix infinite directory reads for offset dir") to prepare for a fix that can work properly on 32-bit systems and might apply to recent LTS kernels where shmem employs the simple_offset mechanism.
Impacted products
Vendor Product Version
Linux Linux Version: 64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a
Version: 64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a
Version: 64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a
Create a notification for this product.
   Linux Linux Version: 6.11
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/libfs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "9e9e710f68bac49bd9b587823c077d06363440e0",
              "status": "affected",
              "version": "64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a",
              "versionType": "git"
            },
            {
              "lessThan": "3f250b82040a72b0059ae00855a74d8570ad2147",
              "status": "affected",
              "version": "64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a",
              "versionType": "git"
            },
            {
              "lessThan": "b662d858131da9a8a14e68661656989b14dbf113",
              "status": "affected",
              "version": "64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/libfs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.11"
            },
            {
              "lessThan": "6.11",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.12",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.13.*",
              "status": "unaffected",
              "version": "6.13.1",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.14-rc1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nRevert \"libfs: fix infinite directory reads for offset dir\"\n\nThe current directory offset allocator (based on mtree_alloc_cyclic)\nstores the next offset value to return in octx-\u003enext_offset. This\nmechanism typically returns values that increase monotonically over\ntime. Eventually, though, the newly allocated offset value wraps\nback to a low number (say, 2) which is smaller than other already-\nallocated offset values.\n\nYu Kuai \u003cyukuai3@huawei.com\u003e reports that, after commit 64a7ce76fb90\n(\"libfs: fix infinite directory reads for offset dir\"), if a\ndirectory\u0027s offset allocator wraps, existing entries are no longer\nvisible via readdir/getdents because offset_readdir() stops listing\nentries once an entry\u0027s offset is larger than octx-\u003enext_offset.\nThese entries vanish persistently -- they can be looked up, but will\nnever again appear in readdir(3) output.\n\nThe reason for this is that the commit treats directory offsets as\nmonotonically increasing integer values rather than opaque cookies,\nand introduces this comparison:\n\n\tif (dentry2offset(dentry) \u003e= last_index) {\n\nOn 64-bit platforms, the directory offset value upper bound is\n2^63 - 1. Directory offsets will monotonically increase for millions\nof years without wrapping.\n\nOn 32-bit platforms, however, LONG_MAX is 2^31 - 1. The allocator\ncan wrap after only a few weeks (at worst).\n\nRevert commit 64a7ce76fb90 (\"libfs: fix infinite directory reads for\noffset dir\") to prepare for a fix that can work properly on 32-bit\nsystems and might apply to recent LTS kernels where shmem employs\nthe simple_offset mechanism."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-02-13T15:37:47.855Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/9e9e710f68bac49bd9b587823c077d06363440e0"
        },
        {
          "url": "https://git.kernel.org/stable/c/3f250b82040a72b0059ae00855a74d8570ad2147"
        },
        {
          "url": "https://git.kernel.org/stable/c/b662d858131da9a8a14e68661656989b14dbf113"
        }
      ],
      "title": "Revert \"libfs: fix infinite directory reads for offset dir\"",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-57952",
    "datePublished": "2025-02-12T13:52:45.229Z",
    "dateReserved": "2025-01-19T11:50:08.381Z",
    "dateUpdated": "2025-02-13T15:37:47.855Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-57952\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-02-12T14:15:31.540\",\"lastModified\":\"2025-02-14T15:52:04.957\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nRevert \\\"libfs: fix infinite directory reads for offset dir\\\"\\n\\nThe current directory offset allocator (based on mtree_alloc_cyclic)\\nstores the next offset value to return in octx-\u003enext_offset. This\\nmechanism typically returns values that increase monotonically over\\ntime. Eventually, though, the newly allocated offset value wraps\\nback to a low number (say, 2) which is smaller than other already-\\nallocated offset values.\\n\\nYu Kuai \u003cyukuai3@huawei.com\u003e reports that, after commit 64a7ce76fb90\\n(\\\"libfs: fix infinite directory reads for offset dir\\\"), if a\\ndirectory\u0027s offset allocator wraps, existing entries are no longer\\nvisible via readdir/getdents because offset_readdir() stops listing\\nentries once an entry\u0027s offset is larger than octx-\u003enext_offset.\\nThese entries vanish persistently -- they can be looked up, but will\\nnever again appear in readdir(3) output.\\n\\nThe reason for this is that the commit treats directory offsets as\\nmonotonically increasing integer values rather than opaque cookies,\\nand introduces this comparison:\\n\\n\\tif (dentry2offset(dentry) \u003e= last_index) {\\n\\nOn 64-bit platforms, the directory offset value upper bound is\\n2^63 - 1. Directory offsets will monotonically increase for millions\\nof years without wrapping.\\n\\nOn 32-bit platforms, however, LONG_MAX is 2^31 - 1. The allocator\\ncan wrap after only a few weeks (at worst).\\n\\nRevert commit 64a7ce76fb90 (\\\"libfs: fix infinite directory reads for\\noffset dir\\\") to prepare for a fix that can work properly on 32-bit\\nsystems and might apply to recent LTS kernels where shmem employs\\nthe simple_offset mechanism.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: Revertir \\\"libfs: fix infinite directory reads for offset dir\\\" El asignador de desplazamiento de directorio actual (basado en mtree_alloc_cyclic) almacena el siguiente valor de desplazamiento a devolver en octx-\u0026gt;next_offset. Este mecanismo normalmente devuelve valores que aumentan mon\u00f3tonamente con el tiempo. Sin embargo, con el tiempo, el valor de desplazamiento recientemente asignado vuelve a un n\u00famero bajo (por ejemplo, 2) que es menor que otros valores de desplazamiento ya asignados. Yu Kuai  informa que, despu\u00e9s del commit 64a7ce76fb90 (\\\"libfs: fix infinite directory reads for offset dir\\\"), si el asignador de desplazamiento de un directorio se cierra, las entradas existentes ya no son visibles a trav\u00e9s de readdir/getdents porque offset_readdir() deja de enumerar las entradas una vez que el desplazamiento de una entrada es mayor que octx-\u0026gt;next_offset. Estas entradas desaparecen de forma persistente: se pueden buscar, pero nunca volver\u00e1n a aparecer en la salida de readdir(3). La raz\u00f3n para esto es que la confirmaci\u00f3n trata los desplazamientos de directorio como valores enteros que aumentan mon\u00f3tonamente en lugar de cookies opacas, e introduce esta comparaci\u00f3n: if (dentry2offset(dentry) \u0026gt;= last_index) { En plataformas de 64 bits, el l\u00edmite superior del valor del desplazamiento de directorio es 2^63 - 1. Los desplazamientos de directorio aumentar\u00e1n mon\u00f3tonamente durante millones de a\u00f1os sin envolverse. Sin embargo, en plataformas de 32 bits, LONG_MAX es 2^31 - 1. El asignador puede envolverse despu\u00e9s de solo unas pocas semanas (en el peor de los casos). Revertir el commit 64a7ce76fb90 (\\\"libfs: arreglar lecturas de directorio infinitas para el desplazamiento dir\\\") para prepararse para una soluci\u00f3n que pueda funcionar correctamente en sistemas de 32 bits y podr\u00eda aplicarse a n\u00facleos LTS recientes donde shmem emplea el mecanismo simple_offset.\"}],\"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:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.11\",\"versionEndExcluding\":\"6.12.12\",\"matchCriteriaId\":\"83A942FD-C5F9-457A-9D54-FBD80CCF0D53\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:-:*:*:*:*:*:*\",\"matchCriteriaId\":\"5A3F9505-6B98-4269-8B81-127E55A1BF00\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"62567B3C-6CEE-46D0-BC2E-B3717FBF7D13\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"5A073481-106D-4B15-B4C7-FB0213B8E1D4\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"DE491969-75AE-4A6B-9A58-8FC5AF98798F\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:*\",\"matchCriteriaId\":\"93C0660D-7FB8-4FBA-892A-B064BA71E49E\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:*\",\"matchCriteriaId\":\"034C36A6-C481-41F3-AE9A-D116E5BE6895\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:*\",\"matchCriteriaId\":\"8AF9DC49-2085-4FFB-A7E3-73DFAFECC7F2\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc7:*:*:*:*:*:*\",\"matchCriteriaId\":\"5DFCDFB8-4FD0-465A-9076-D813D78FE51B\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/3f250b82040a72b0059ae00855a74d8570ad2147\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/9e9e710f68bac49bd9b587823c077d06363440e0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/b662d858131da9a8a14e68661656989b14dbf113\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


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.