CVE-2024-57952 (GCVE-0-2024-57952)
Vulnerability from cvelistv5
Published
2025-02-12 13:52
Modified
2026-08-05 11:47
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
Version: 308b4fc2403b335894592ee9dc212a5e58bb309f
Version: 6.10.7   
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "LOW",
              "attackVector": "LOCAL",
              "availabilityImpact": "HIGH",
              "baseScore": 5.5,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "NONE",
              "integrityImpact": "NONE",
              "privilegesRequired": "LOW",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2024-57952",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-10-01T19:51:08.146468Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "problemTypes": [
          {
            "descriptions": [
              {
                "description": "CWE-noinfo Not enough information",
                "lang": "en",
                "type": "CWE"
              }
            ]
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-10-01T19:57:09.380Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "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"
            },
            {
              "status": "affected",
              "version": "308b4fc2403b335894592ee9dc212a5e58bb309f",
              "versionType": "git"
            },
            {
              "lessThan": "6.11",
              "status": "affected",
              "version": "6.10.7",
              "versionType": "semver"
            }
          ]
        },
        {
          "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",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.12",
                  "versionStartIncluding": "6.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.13.1",
                  "versionStartIncluding": "6.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14",
                  "versionStartIncluding": "6.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "6.10.7",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "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."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.1,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The offset allocator is driven and the corrupted listing observed entirely through ordinary local filesystem syscalls (creat/rename/unlink and getdents64) on a mounted tmpfs. No network protocol handler is involved.\nAC:L - Exhausting the 2^31 offset space on a 32-bit kernel is a fully deterministic attacker-driven loop with no race window, no memory-layout dependency, and no unknown state \u2014 it succeeds every time, and the same condition even arises spontaneously in normal operation within weeks.\nPR:L - Only an unprivileged local account is needed; /tmp and /dev/shm are world-writable tmpfs by default, and the offset context is per-directory and shared, so ordinary create/unlink rights suffice to exhaust it for every user of that directory.\nUI:N - The attacker triggers the wrap entirely with their own syscalls; victims are affected simply by listing the directory afterwards, requiring no action on their part.\nS:U - The defect and its consequences are confined to the kernel\u0027s tmpfs/libfs layer within the same security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:N - The flaw causes entries to be omitted from directory listings rather than exposed; no kernel memory, pointer, or otherwise inaccessible data is disclosed to the attacker.\nI:H - An unprivileged attacker causes the kernel to return systematically falsified directory contents for a shared tmpfs directory, permanently hiding an unbounded set of other users\u0027 entries so that backup, archival, cleanup, and audit tooling silently operate on and destroy an incorrect view of the data.\nA:H - Directory enumeration of the affected tmpfs directory is completely and persistently broken for all hidden entries across every process on the system, rendering those files unreachable to any enumeration-based consumer until unmount or reboot."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:47:03.053Z",
        "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-1.2.0"
      }
    }
  },
  "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": "2026-08-05T11:47:03.053Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 5.5, \"attackVector\": \"LOCAL\", \"baseSeverity\": \"MEDIUM\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\", \"integrityImpact\": \"NONE\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"LOW\", \"confidentialityImpact\": \"NONE\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-57952\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-10-01T19:51:08.146468Z\"}}}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"description\": \"CWE-noinfo Not enough information\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-10-01T16:00:10.468Z\"}}], \"cna\": {\"title\": \"Revert \\\"libfs: fix infinite directory reads for offset dir\\\"\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"baseScore\": 7.1, \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:L - The offset allocator is driven and the corrupted listing observed entirely through ordinary local filesystem syscalls (creat/rename/unlink and getdents64) on a mounted tmpfs. No network protocol handler is involved.\\nAC:L - Exhausting the 2^31 offset space on a 32-bit kernel is a fully deterministic attacker-driven loop with no race window, no memory-layout dependency, and no unknown state \\u2014 it succeeds every time, and the same condition even arises spontaneously in normal operation within weeks.\\nPR:L - Only an unprivileged local account is needed; /tmp and /dev/shm are world-writable tmpfs by default, and the offset context is per-directory and shared, so ordinary create/unlink rights suffice to exhaust it for every user of that directory.\\nUI:N - The attacker triggers the wrap entirely with their own syscalls; victims are affected simply by listing the directory afterwards, requiring no action on their part.\\nS:U - The defect and its consequences are confined to the kernel\u0027s tmpfs/libfs layer within the same security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\\nC:N - The flaw causes entries to be omitted from directory listings rather than exposed; no kernel memory, pointer, or otherwise inaccessible data is disclosed to the attacker.\\nI:H - An unprivileged attacker causes the kernel to return systematically falsified directory contents for a shared tmpfs directory, permanently hiding an unbounded set of other users\u0027 entries so that backup, archival, cleanup, and audit tooling silently operate on and destroy an incorrect view of the data.\\nA:H - Directory enumeration of the affected tmpfs directory is completely and persistently broken for all hidden entries across every process on the system, rendering those files unreachable to any enumeration-based consumer until unmount or reboot.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a\", \"lessThan\": \"9e9e710f68bac49bd9b587823c077d06363440e0\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a\", \"lessThan\": \"3f250b82040a72b0059ae00855a74d8570ad2147\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a\", \"lessThan\": \"b662d858131da9a8a14e68661656989b14dbf113\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"308b4fc2403b335894592ee9dc212a5e58bb309f\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6.10.7\", \"lessThan\": \"6.11\", \"versionType\": \"semver\"}], \"programFiles\": [\"fs/libfs.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.11\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.11\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.12.12\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.12.*\"}, {\"status\": \"unaffected\", \"version\": \"6.13.1\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.13.*\"}, {\"status\": \"unaffected\", \"version\": \"6.14\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"fs/libfs.c\"], \"defaultStatus\": \"affected\"}], \"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\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"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.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.12.12\", \"versionStartIncluding\": \"6.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.13.1\", \"versionStartIncluding\": \"6.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.14\", \"versionStartIncluding\": \"6.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionStartIncluding\": \"6.10.7\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T11:47:03.053Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-57952\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T11:47:03.053Z\", \"dateReserved\": \"2025-01-19T11:50:08.381Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2025-02-12T13:52:45.229Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


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.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • 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.


Loading…

Loading…