Skip to content
Heist/ feed
Back to feed
UnratedFix available

xfs: don't walk off the end of a directory data block

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: xfs: don't walk off the end of a directory data block This adds sanity checks for xfs_dir2_data_unused and xfs_dir2_data_entry to make sure don't stray beyond valid memory region. Before patching, the loop simply checks that the start offset of the dup and dep is within the range. So in a crafted image, if last entry is xfs_dir2_data_unused, we can change dup->length to dup->length-1 and leave 1 byte of space. In the next traversal, this space will be considered as dup or dep. We may encounter an out of bound read when accessing the fixed members. In the patch, we make sure that the remaining bytes large enough to hold an unused entry before accessing xfs_dir2_data_unused and xfs_dir2_data_unused is XFS_DIR2_DATA_ALIGN byte aligned. We also make sure that the remaining bytes large enough to hold a dirent with a single-byte name before accessing xfs_dir2_data_entry.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.1.142, 6.6.68
CVEs
CVE-2024-41013
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 13:28 UTC · Revision 1

Source evidence

xfs: don't walk off the end of a directory data block

core-osv · Original source

Published 29 Jul 2024, 06:36 UTC

In the Linux kernel, the following vulnerability has been resolved: xfs: don't walk off the end of a directory data block This adds sanity checks for xfs_dir2_data_unused and xfs_dir2_data_entry to make sure don't stray beyond valid memory region. Before patching, the loop simply checks that the start offset of the dup and dep is within the range. So in a crafted image, if last entry is xfs_dir2_data_unused, we can change dup->length to dup->length-1 and leave 1 byte of space. In the next traversal, this space will be considered as dup or dep. We may encounter an out of bound read when accessing the fixed members. In the patch, we make sure that the remaining bytes large enough to hold an unused entry before accessing xfs_dir2_data_unused and xfs_dir2_data_unused is XFS_DIR2_DATA_ALIGN byte aligned. We also make sure that the remaining bytes large enough to hold a dirent with a single-byte name before accessing xfs_dir2_data_entry.

osv:CVE-2024-41013

Kernel

Fixed versions: 6.1.142, 6.6.68

Complete source record
{
  "id": "a08d2377e8f8aeb32b65acf407e9b103c55b55df6a8f5001a65f253532ed51e8",
  "url": "https://osv.dev/vulnerability/CVE-2024-41013",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "xfs: don't walk off the end of a directory data block",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: xfs: don't walk off the end of a directory data block This adds sanity checks for xfs_dir2_data_unused and xfs_dir2_data_entry to make sure don't stray beyond valid memory region. Before patching, the loop simply checks that the start offset of the dup and dep is within the range. So in a crafted image, if last entry is xfs_dir2_data_unused, we can change dup->length to dup->length-1 and leave 1 byte of space. In the next traversal, this space will be considered as dup or dep. We may encounter an out of bound read when accessing the fixed members. In the patch, we make sure that the remaining bytes large enough to hold an unused entry before accessing xfs_dir2_data_unused and xfs_dir2_data_unused is XFS_DIR2_DATA_ALIGN byte aligned. We also make sure that the remaining bytes large enough to hold a dirent with a single-byte name before accessing xfs_dir2_data_entry.",
    "evidence": "osv:CVE-2024-41013",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.1.142",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.68",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-41013",
      "aliases": [
        "CVE-2024-41013"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "82025d7f79148fe66a1594a0ebe4ab38152cf9e6"
                },
                {
                  "fixed": "b0932e4f9da85349d1c8f2a77d2a7a7163b8511d"
                },
                {
                  "fixed": "ca96d83c93071f95cf962ce92406621a472df31b"
                },
                {
                  "fixed": "0c7fcdb6d06cdf8b19b57c17605215b06afa864a"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-41013.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "3.8.0"
                },
                {
                  "fixed": "6.1.142"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.68"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-41013.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:35.839222278Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/0c7fcdb6d06cdf8b19b57c17605215b06afa864a",
        "https://git.kernel.org/stable/c/b0932e4f9da85349d1c8f2a77d2a7a7163b8511d",
        "https://git.kernel.org/stable/c/ca96d83c93071f95cf962ce92406621a472df31b",
        "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/41xxx/CVE-2024-41013.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-41013",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/41xxx/CVE-2024-41013.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-41013",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 503122,
  "published_at": "2024-07-29T06:36:59.93+00:00"
}