CVE-2025-38221 (GCVE-0-2025-38221)
Vulnerability from cvelistv5
Published
2025-07-04 13:37
Modified
2025-08-09 14:20
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: ext4: fix out of bounds punch offset Punching a hole with a start offset that exceeds max_end is not permitted and will result in a negative length in the truncate_inode_partial_folio() function while truncating the page cache, potentially leading to undesirable consequences. A simple reproducer: truncate -s 9895604649994 /mnt/foo xfs_io -c "pwrite 8796093022208 4096" /mnt/foo xfs_io -c "fpunch 8796093022213 25769803777" /mnt/foo kernel BUG at include/linux/highmem.h:275! Oops: invalid opcode: 0000 [#1] SMP PTI CPU: 3 UID: 0 PID: 710 Comm: xfs_io Not tainted 6.15.0-rc3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014 RIP: 0010:zero_user_segments.constprop.0+0xd7/0x110 RSP: 0018:ffffc90001cf3b38 EFLAGS: 00010287 RAX: 0000000000000005 RBX: ffffea0001485e40 RCX: 0000000000001000 RDX: 000000000040b000 RSI: 0000000000000005 RDI: 000000000040b000 RBP: 000000000040affb R08: ffff888000000000 R09: ffffea0000000000 R10: 0000000000000003 R11: 00000000fffc7fc5 R12: 0000000000000005 R13: 000000000040affb R14: ffffea0001485e40 R15: ffff888031cd3000 FS: 00007f4f63d0b780(0000) GS:ffff8880d337d000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000001ae0b038 CR3: 00000000536aa000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> truncate_inode_partial_folio+0x3dd/0x620 truncate_inode_pages_range+0x226/0x720 ? bdev_getblk+0x52/0x3e0 ? ext4_get_group_desc+0x78/0x150 ? crc32c_arch+0xfd/0x180 ? __ext4_get_inode_loc+0x18c/0x840 ? ext4_inode_csum+0x117/0x160 ? jbd2_journal_dirty_metadata+0x61/0x390 ? __ext4_handle_dirty_metadata+0xa0/0x2b0 ? kmem_cache_free+0x90/0x5a0 ? jbd2_journal_stop+0x1d5/0x550 ? __ext4_journal_stop+0x49/0x100 truncate_pagecache_range+0x50/0x80 ext4_truncate_page_cache_block_range+0x57/0x3a0 ext4_punch_hole+0x1fe/0x670 ext4_fallocate+0x792/0x17d0 ? __count_memcg_events+0x175/0x2a0 vfs_fallocate+0x121/0x560 ksys_fallocate+0x51/0xc0 __x64_sys_fallocate+0x24/0x40 x64_sys_call+0x18d2/0x4170 do_syscall_64+0xa7/0x220 entry_SYSCALL_64_after_hwframe+0x76/0x7e Fix this by filtering out cases where the punching start offset exceeds max_end.
Impacted products
Vendor Product Version
Linux Linux Version: 33f61ecabb10098b63dad3b729552779379f900d
Version: 982bf37da09d078570650b691d9084f43805a5de
Version: 982bf37da09d078570650b691d9084f43805a5de
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/ext4/inode.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "a4d60ba277ecd8a98c5a593cbc0ef2237c20a541",
              "status": "affected",
              "version": "33f61ecabb10098b63dad3b729552779379f900d",
              "versionType": "git"
            },
            {
              "lessThan": "28b62cb58fd014338f5004170f2e3a35bf0af238",
              "status": "affected",
              "version": "982bf37da09d078570650b691d9084f43805a5de",
              "versionType": "git"
            },
            {
              "lessThan": "b5e58bcd79625423487fa3ecba8e8411b5396327",
              "status": "affected",
              "version": "982bf37da09d078570650b691d9084f43805a5de",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/ext4/inode.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.15"
            },
            {
              "lessThan": "6.15",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.15.*",
              "status": "unaffected",
              "version": "6.15.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15.4",
                  "versionStartIncluding": "6.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16",
                  "versionStartIncluding": "6.15",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\next4: fix out of bounds punch offset\n\nPunching a hole with a start offset that exceeds max_end is not\npermitted and will result in a negative length in the\ntruncate_inode_partial_folio() function while truncating the page cache,\npotentially leading to undesirable consequences.\n\nA simple reproducer:\n\n  truncate -s 9895604649994 /mnt/foo\n  xfs_io -c \"pwrite 8796093022208 4096\" /mnt/foo\n  xfs_io -c \"fpunch 8796093022213 25769803777\" /mnt/foo\n\n  kernel BUG at include/linux/highmem.h:275!\n  Oops: invalid opcode: 0000 [#1] SMP PTI\n  CPU: 3 UID: 0 PID: 710 Comm: xfs_io Not tainted 6.15.0-rc3\n  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014\n  RIP: 0010:zero_user_segments.constprop.0+0xd7/0x110\n  RSP: 0018:ffffc90001cf3b38 EFLAGS: 00010287\n  RAX: 0000000000000005 RBX: ffffea0001485e40 RCX: 0000000000001000\n  RDX: 000000000040b000 RSI: 0000000000000005 RDI: 000000000040b000\n  RBP: 000000000040affb R08: ffff888000000000 R09: ffffea0000000000\n  R10: 0000000000000003 R11: 00000000fffc7fc5 R12: 0000000000000005\n  R13: 000000000040affb R14: ffffea0001485e40 R15: ffff888031cd3000\n  FS:  00007f4f63d0b780(0000) GS:ffff8880d337d000(0000)\n  knlGS:0000000000000000\n  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n  CR2: 000000001ae0b038 CR3: 00000000536aa000 CR4: 00000000000006f0\n  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000\n  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400\n  Call Trace:\n   \u003cTASK\u003e\n   truncate_inode_partial_folio+0x3dd/0x620\n   truncate_inode_pages_range+0x226/0x720\n   ? bdev_getblk+0x52/0x3e0\n   ? ext4_get_group_desc+0x78/0x150\n   ? crc32c_arch+0xfd/0x180\n   ? __ext4_get_inode_loc+0x18c/0x840\n   ? ext4_inode_csum+0x117/0x160\n   ? jbd2_journal_dirty_metadata+0x61/0x390\n   ? __ext4_handle_dirty_metadata+0xa0/0x2b0\n   ? kmem_cache_free+0x90/0x5a0\n   ? jbd2_journal_stop+0x1d5/0x550\n   ? __ext4_journal_stop+0x49/0x100\n   truncate_pagecache_range+0x50/0x80\n   ext4_truncate_page_cache_block_range+0x57/0x3a0\n   ext4_punch_hole+0x1fe/0x670\n   ext4_fallocate+0x792/0x17d0\n   ? __count_memcg_events+0x175/0x2a0\n   vfs_fallocate+0x121/0x560\n   ksys_fallocate+0x51/0xc0\n   __x64_sys_fallocate+0x24/0x40\n   x64_sys_call+0x18d2/0x4170\n   do_syscall_64+0xa7/0x220\n   entry_SYSCALL_64_after_hwframe+0x76/0x7e\n\nFix this by filtering out cases where the punching start offset exceeds\nmax_end."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-08-09T14:20:12.668Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/a4d60ba277ecd8a98c5a593cbc0ef2237c20a541"
        },
        {
          "url": "https://git.kernel.org/stable/c/28b62cb58fd014338f5004170f2e3a35bf0af238"
        },
        {
          "url": "https://git.kernel.org/stable/c/b5e58bcd79625423487fa3ecba8e8411b5396327"
        }
      ],
      "title": "ext4: fix out of bounds punch offset",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38221",
    "datePublished": "2025-07-04T13:37:37.248Z",
    "dateReserved": "2025-04-16T04:51:23.995Z",
    "dateUpdated": "2025-08-09T14:20:12.668Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-38221\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-07-04T14:15:30.723\",\"lastModified\":\"2025-08-01T09:15:32.603\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\next4: fix out of bounds punch offset\\n\\nPunching a hole with a start offset that exceeds max_end is not\\npermitted and will result in a negative length in the\\ntruncate_inode_partial_folio() function while truncating the page cache,\\npotentially leading to undesirable consequences.\\n\\nA simple reproducer:\\n\\n  truncate -s 9895604649994 /mnt/foo\\n  xfs_io -c \\\"pwrite 8796093022208 4096\\\" /mnt/foo\\n  xfs_io -c \\\"fpunch 8796093022213 25769803777\\\" /mnt/foo\\n\\n  kernel BUG at include/linux/highmem.h:275!\\n  Oops: invalid opcode: 0000 [#1] SMP PTI\\n  CPU: 3 UID: 0 PID: 710 Comm: xfs_io Not tainted 6.15.0-rc3\\n  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014\\n  RIP: 0010:zero_user_segments.constprop.0+0xd7/0x110\\n  RSP: 0018:ffffc90001cf3b38 EFLAGS: 00010287\\n  RAX: 0000000000000005 RBX: ffffea0001485e40 RCX: 0000000000001000\\n  RDX: 000000000040b000 RSI: 0000000000000005 RDI: 000000000040b000\\n  RBP: 000000000040affb R08: ffff888000000000 R09: ffffea0000000000\\n  R10: 0000000000000003 R11: 00000000fffc7fc5 R12: 0000000000000005\\n  R13: 000000000040affb R14: ffffea0001485e40 R15: ffff888031cd3000\\n  FS:  00007f4f63d0b780(0000) GS:ffff8880d337d000(0000)\\n  knlGS:0000000000000000\\n  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\\n  CR2: 000000001ae0b038 CR3: 00000000536aa000 CR4: 00000000000006f0\\n  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000\\n  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400\\n  Call Trace:\\n   \u003cTASK\u003e\\n   truncate_inode_partial_folio+0x3dd/0x620\\n   truncate_inode_pages_range+0x226/0x720\\n   ? bdev_getblk+0x52/0x3e0\\n   ? ext4_get_group_desc+0x78/0x150\\n   ? crc32c_arch+0xfd/0x180\\n   ? __ext4_get_inode_loc+0x18c/0x840\\n   ? ext4_inode_csum+0x117/0x160\\n   ? jbd2_journal_dirty_metadata+0x61/0x390\\n   ? __ext4_handle_dirty_metadata+0xa0/0x2b0\\n   ? kmem_cache_free+0x90/0x5a0\\n   ? jbd2_journal_stop+0x1d5/0x550\\n   ? __ext4_journal_stop+0x49/0x100\\n   truncate_pagecache_range+0x50/0x80\\n   ext4_truncate_page_cache_block_range+0x57/0x3a0\\n   ext4_punch_hole+0x1fe/0x670\\n   ext4_fallocate+0x792/0x17d0\\n   ? __count_memcg_events+0x175/0x2a0\\n   vfs_fallocate+0x121/0x560\\n   ksys_fallocate+0x51/0xc0\\n   __x64_sys_fallocate+0x24/0x40\\n   x64_sys_call+0x18d2/0x4170\\n   do_syscall_64+0xa7/0x220\\n   entry_SYSCALL_64_after_hwframe+0x76/0x7e\\n\\nFix this by filtering out cases where the punching start offset exceeds\\nmax_end.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ext4: correcci\u00f3n de un desplazamiento de perforaci\u00f3n fuera de los l\u00edmites. Perforar un agujero con un desplazamiento inicial superior a max_end no est\u00e1 permitido y resultar\u00e1 en una longitud negativa en la funci\u00f3n truncate_inode_partial_folio() al truncar la cach\u00e9 de p\u00e1gina, lo que podr\u00eda tener consecuencias indeseables. Un simple reproductor:  truncate -s 9895604649994 /mnt/foo xfs_io -c \\\"pwrite 8796093022208 4096\\\" /mnt/foo xfs_io -c \\\"fpunch 8796093022213 25769803777\\\" /mnt/foo kernel BUG at include/linux/highmem.h:275! Oops: invalid opcode: 0000 [#1] SMP PTI CPU: 3 UID: 0 PID: 710 Comm: xfs_io Not tainted 6.15.0-rc3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014 RIP: 0010:zero_user_segments.constprop.0+0xd7/0x110 RSP: 0018:ffffc90001cf3b38 EFLAGS: 00010287 RAX: 0000000000000005 RBX: ffffea0001485e40 RCX: 0000000000001000 RDX: 000000000040b000 RSI: 0000000000000005 RDI: 000000000040b000 RBP: 000000000040affb R08: ffff888000000000 R09: ffffea0000000000 R10: 0000000000000003 R11: 00000000fffc7fc5 R12: 0000000000000005 R13: 000000000040affb R14: ffffea0001485e40 R15: ffff888031cd3000 FS: 00007f4f63d0b780(0000) GS:ffff8880d337d000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000001ae0b038 CR3: 00000000536aa000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Rastreo de llamadas:  truncate_inode_partial_folio+0x3dd/0x620 truncate_inode_pages_range+0x226/0x720 ? bdev_getblk+0x52/0x3e0 ? ext4_get_group_desc+0x78/0x150 ? crc32c_arch+0xfd/0x180 ? __ext4_get_inode_loc+0x18c/0x840 ? ext4_inode_csum+0x117/0x160 ? jbd2_journal_dirty_metadata+0x61/0x390 ? __ext4_handle_dirty_metadata+0xa0/0x2b0 ? kmem_cache_free+0x90/0x5a0 ? jbd2_journal_stop+0x1d5/0x550 ? __ext4_journal_stop+0x49/0x100 truncate_pagecache_range+0x50/0x80 ext4_truncate_page_cache_block_range+0x57/0x3a0 ext4_punch_hole+0x1fe/0x670 ext4_fallocate+0x792/0x17d0 ? __count_memcg_events+0x175/0x2a0 vfs_fallocate+0x121/0x560 ksys_fallocate+0x51/0xc0 __x64_sys_fallocate+0x24/0x40 x64_sys_call+0x18d2/0x4170 do_syscall_64+0xa7/0x220 entry_SYSCALL_64_after_hwframe+0x76/0x7e Solucione esto filtrando los casos en los que el desplazamiento de inicio de perforaci\u00f3n exceda max_end.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/28b62cb58fd014338f5004170f2e3a35bf0af238\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a4d60ba277ecd8a98c5a593cbc0ef2237c20a541\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b5e58bcd79625423487fa3ecba8e8411b5396327\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


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.


Loading…

Loading…