cve-2024-57883
Vulnerability from cvelistv5
Published
2025-01-15 13:05
Modified
2025-01-20 06:28
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: mm: hugetlb: independent PMD page table shared count The folio refcount may be increased unexpectly through try_get_folio() by caller such as split_huge_pages. In huge_pmd_unshare(), we use refcount to check whether a pmd page table is shared. The check is incorrect if the refcount is increased by the above caller, and this can cause the page table leaked: BUG: Bad page state in process sh pfn:109324 page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x66 pfn:0x109324 flags: 0x17ffff800000000(node=0|zone=2|lastcpupid=0xfffff) page_type: f2(table) raw: 017ffff800000000 0000000000000000 0000000000000000 0000000000000000 raw: 0000000000000066 0000000000000000 00000000f2000000 0000000000000000 page dumped because: nonzero mapcount ... CPU: 31 UID: 0 PID: 7515 Comm: sh Kdump: loaded Tainted: G B 6.13.0-rc2master+ #7 Tainted: [B]=BAD_PAGE Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 Call trace: show_stack+0x20/0x38 (C) dump_stack_lvl+0x80/0xf8 dump_stack+0x18/0x28 bad_page+0x8c/0x130 free_page_is_bad_report+0xa4/0xb0 free_unref_page+0x3cc/0x620 __folio_put+0xf4/0x158 split_huge_pages_all+0x1e0/0x3e8 split_huge_pages_write+0x25c/0x2d8 full_proxy_write+0x64/0xd8 vfs_write+0xcc/0x280 ksys_write+0x70/0x110 __arm64_sys_write+0x24/0x38 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0xc8/0xf0 do_el0_svc+0x24/0x38 el0_svc+0x34/0x128 el0t_64_sync_handler+0xc8/0xd0 el0t_64_sync+0x190/0x198 The issue may be triggered by damon, offline_page, page_idle, etc, which will increase the refcount of page table. 1. The page table itself will be discarded after reporting the "nonzero mapcount". 2. The HugeTLB page mapped by the page table miss freeing since we treat the page table as shared and a shared page table will not be unmapped. Fix it by introducing independent PMD page table shared count. As described by comment, pt_index/pt_mm/pt_frag_refcount are used for s390 gmap, x86 pgds and powerpc, pt_share_count is used for x86/arm64/riscv pmds, so we can reuse the field as pt_share_count.
Impacted products
Vendor Product Version
Linux Linux Version: 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa
Version: 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa
Version: 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa
Create a notification for this product.
   Linux Linux Version: 2.6.20
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "include/linux/mm.h",
            "include/linux/mm_types.h",
            "mm/hugetlb.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "56b274473d6e7e7375f2d0a2b4aca11d67c6b52f",
              "status": "affected",
              "version": "39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa",
              "versionType": "git"
            },
            {
              "lessThan": "2e31443a0d18ae43b9d29e02bf0563f07772193d",
              "status": "affected",
              "version": "39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa",
              "versionType": "git"
            },
            {
              "lessThan": "59d9094df3d79443937add8700b2ef1a866b1081",
              "status": "affected",
              "version": "39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "include/linux/mm.h",
            "include/linux/mm_types.h",
            "mm/hugetlb.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "2.6.20"
            },
            {
              "lessThan": "2.6.20",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.72",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.9",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm: hugetlb: independent PMD page table shared count\n\nThe folio refcount may be increased unexpectly through try_get_folio() by\ncaller such as split_huge_pages.  In huge_pmd_unshare(), we use refcount\nto check whether a pmd page table is shared.  The check is incorrect if\nthe refcount is increased by the above caller, and this can cause the page\ntable leaked:\n\n BUG: Bad page state in process sh  pfn:109324\n page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x66 pfn:0x109324\n flags: 0x17ffff800000000(node=0|zone=2|lastcpupid=0xfffff)\n page_type: f2(table)\n raw: 017ffff800000000 0000000000000000 0000000000000000 0000000000000000\n raw: 0000000000000066 0000000000000000 00000000f2000000 0000000000000000\n page dumped because: nonzero mapcount\n ...\n CPU: 31 UID: 0 PID: 7515 Comm: sh Kdump: loaded Tainted: G    B              6.13.0-rc2master+ #7\n Tainted: [B]=BAD_PAGE\n Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015\n Call trace:\n  show_stack+0x20/0x38 (C)\n  dump_stack_lvl+0x80/0xf8\n  dump_stack+0x18/0x28\n  bad_page+0x8c/0x130\n  free_page_is_bad_report+0xa4/0xb0\n  free_unref_page+0x3cc/0x620\n  __folio_put+0xf4/0x158\n  split_huge_pages_all+0x1e0/0x3e8\n  split_huge_pages_write+0x25c/0x2d8\n  full_proxy_write+0x64/0xd8\n  vfs_write+0xcc/0x280\n  ksys_write+0x70/0x110\n  __arm64_sys_write+0x24/0x38\n  invoke_syscall+0x50/0x120\n  el0_svc_common.constprop.0+0xc8/0xf0\n  do_el0_svc+0x24/0x38\n  el0_svc+0x34/0x128\n  el0t_64_sync_handler+0xc8/0xd0\n  el0t_64_sync+0x190/0x198\n\nThe issue may be triggered by damon, offline_page, page_idle, etc, which\nwill increase the refcount of page table.\n\n1. The page table itself will be discarded after reporting the\n   \"nonzero mapcount\".\n\n2. The HugeTLB page mapped by the page table miss freeing since we\n   treat the page table as shared and a shared page table will not be\n   unmapped.\n\nFix it by introducing independent PMD page table shared count.  As\ndescribed by comment, pt_index/pt_mm/pt_frag_refcount are used for s390\ngmap, x86 pgds and powerpc, pt_share_count is used for x86/arm64/riscv\npmds, so we can reuse the field as pt_share_count."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-01-20T06:28:50.163Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/56b274473d6e7e7375f2d0a2b4aca11d67c6b52f"
        },
        {
          "url": "https://git.kernel.org/stable/c/2e31443a0d18ae43b9d29e02bf0563f07772193d"
        },
        {
          "url": "https://git.kernel.org/stable/c/59d9094df3d79443937add8700b2ef1a866b1081"
        }
      ],
      "title": "mm: hugetlb: independent PMD page table shared count",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-57883",
    "datePublished": "2025-01-15T13:05:36.352Z",
    "dateReserved": "2025-01-11T14:45:42.024Z",
    "dateUpdated": "2025-01-20T06:28:50.163Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-57883\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-01-15T13:15:12.637\",\"lastModified\":\"2025-01-17T14:15:32.357\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmm: hugetlb: independent PMD page table shared count\\n\\nThe folio refcount may be increased unexpectly through try_get_folio() by\\ncaller such as split_huge_pages.  In huge_pmd_unshare(), we use refcount\\nto check whether a pmd page table is shared.  The check is incorrect if\\nthe refcount is increased by the above caller, and this can cause the page\\ntable leaked:\\n\\n BUG: Bad page state in process sh  pfn:109324\\n page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x66 pfn:0x109324\\n flags: 0x17ffff800000000(node=0|zone=2|lastcpupid=0xfffff)\\n page_type: f2(table)\\n raw: 017ffff800000000 0000000000000000 0000000000000000 0000000000000000\\n raw: 0000000000000066 0000000000000000 00000000f2000000 0000000000000000\\n page dumped because: nonzero mapcount\\n ...\\n CPU: 31 UID: 0 PID: 7515 Comm: sh Kdump: loaded Tainted: G    B              6.13.0-rc2master+ #7\\n Tainted: [B]=BAD_PAGE\\n Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015\\n Call trace:\\n  show_stack+0x20/0x38 (C)\\n  dump_stack_lvl+0x80/0xf8\\n  dump_stack+0x18/0x28\\n  bad_page+0x8c/0x130\\n  free_page_is_bad_report+0xa4/0xb0\\n  free_unref_page+0x3cc/0x620\\n  __folio_put+0xf4/0x158\\n  split_huge_pages_all+0x1e0/0x3e8\\n  split_huge_pages_write+0x25c/0x2d8\\n  full_proxy_write+0x64/0xd8\\n  vfs_write+0xcc/0x280\\n  ksys_write+0x70/0x110\\n  __arm64_sys_write+0x24/0x38\\n  invoke_syscall+0x50/0x120\\n  el0_svc_common.constprop.0+0xc8/0xf0\\n  do_el0_svc+0x24/0x38\\n  el0_svc+0x34/0x128\\n  el0t_64_sync_handler+0xc8/0xd0\\n  el0t_64_sync+0x190/0x198\\n\\nThe issue may be triggered by damon, offline_page, page_idle, etc, which\\nwill increase the refcount of page table.\\n\\n1. The page table itself will be discarded after reporting the\\n   \\\"nonzero mapcount\\\".\\n\\n2. The HugeTLB page mapped by the page table miss freeing since we\\n   treat the page table as shared and a shared page table will not be\\n   unmapped.\\n\\nFix it by introducing independent PMD page table shared count.  As\\ndescribed by comment, pt_index/pt_mm/pt_frag_refcount are used for s390\\ngmap, x86 pgds and powerpc, pt_share_count is used for x86/arm64/riscv\\npmds, so we can reuse the field as pt_share_count.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm: hugetlb: recuento compartido de la tabla de p\u00e1ginas PMD independiente El recuento de referencias de folio puede aumentar inesperadamente a trav\u00e9s de try_get_folio() por un llamador como split_huge_pages. En huge_pmd_unshare(), usamos el recuento de referencias para verificar si una tabla de p\u00e1ginas pmd est\u00e1 compartida. La comprobaci\u00f3n es incorrecta si el llamador anterior aumenta el refcount, y esto puede provocar una fuga de la tabla de p\u00e1ginas: ERROR: Estado de p\u00e1gina incorrecto en proceso sh pfn:109324 p\u00e1gina: refcount:0 mapcount:0 mapping:0000000000000000 \u00edndice:0x66 pfn:0x109324 indicadores: 0x17ffff800000000(nodo=0|zona=2|lastcpupid=0xfffff) tipo_p\u00e1gina: f2(tabla) sin procesar: 017ffff800000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 sin procesar: 0000000000000066 0000000000000000 00000000f2000000 0000000000000000 p\u00e1gina volcada porque: mapcount distinto de cero ... CPU: 31 UID: 0 PID: 7515 Comm: sh Kdump: cargado Contaminado: GB 6.13.0-rc2master+ #7 Contaminado: [B]=BAD_PAGE Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 Call trace: show_stack+0x20/0x38 (C) dump_stack_lvl+0x80/0xf8 dump_stack+0x18/0x28 bad_page+0x8c/0x130 free_page_is_bad_report+0xa4/0xb0 free_unref_page+0x3cc/0x620 __folio_put+0xf4/0x158 split_huge_pages_all+0x1e0/0x3e8 split_huge_pages_write+0x25c/0x2d8 full_proxy_write+0x64/0xd8 vfs_write+0xcc/0x280 ksys_write+0x70/0x110 __arm64_sys_write+0x24/0x38 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0xc8/0xf0 do_el0_svc+0x24/0x38 el0_svc+0x34/0x128 el0t_64_sync_handler+0xc8/0xd0 el0t_64_sync+0x190/0x198 El problema puede ser provocado por damon, offline_page, page_idle, etc., que aumentar\u00e1n el recuento de referencias de la tabla de p\u00e1ginas. 1. La tabla de p\u00e1ginas en s\u00ed se descartar\u00e1 despu\u00e9s de informar el \\\"recuento de mapas distinto de cero\\\". 2. La p\u00e1gina HugeTLB mapeada por la tabla de p\u00e1ginas no se libera ya que tratamos la tabla de p\u00e1ginas como compartida y una tabla de p\u00e1ginas compartida no se desasignar\u00e1. Arr\u00e9glelo introduciendo un recuento de p\u00e1ginas compartidas de tabla de p\u00e1ginas PMD independiente. Como se describe en el comentario, pt_index/pt_mm/pt_frag_refcount se utilizan para s390 gmap, x86 pgds y powerpc, pt_share_count se utiliza para x86/arm64/riscv pmds, por lo que podemos reutilizar el campo como pt_share_count.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/2e31443a0d18ae43b9d29e02bf0563f07772193d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/56b274473d6e7e7375f2d0a2b4aca11d67c6b52f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/59d9094df3d79443937add8700b2ef1a866b1081\",\"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.