cve-2024-56612
Vulnerability from cvelistv5
Published
2024-12-27 14:51
Modified
2025-01-20 06:24
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: mm/gup: handle NULL pages in unpin_user_pages() The recent addition of "pofs" (pages or folios) handling to gup has a flaw: it assumes that unpin_user_pages() handles NULL pages in the pages** array. That's not the case, as I discovered when I ran on a new configuration on my test machine. Fix this by skipping NULL pages in unpin_user_pages(), just like unpin_folios() already does. Details: when booting on x86 with "numa=fake=2 movablecore=4G" on Linux 6.12, and running this: tools/testing/selftests/mm/gup_longterm ...I get the following crash: BUG: kernel NULL pointer dereference, address: 0000000000000008 RIP: 0010:sanity_check_pinned_pages+0x3a/0x2d0 ... Call Trace: <TASK> ? __die_body+0x66/0xb0 ? page_fault_oops+0x30c/0x3b0 ? do_user_addr_fault+0x6c3/0x720 ? irqentry_enter+0x34/0x60 ? exc_page_fault+0x68/0x100 ? asm_exc_page_fault+0x22/0x30 ? sanity_check_pinned_pages+0x3a/0x2d0 unpin_user_pages+0x24/0xe0 check_and_migrate_movable_pages_or_folios+0x455/0x4b0 __gup_longterm_locked+0x3bf/0x820 ? mmap_read_lock_killable+0x12/0x50 ? __pfx_mmap_read_lock_killable+0x10/0x10 pin_user_pages+0x66/0xa0 gup_test_ioctl+0x358/0xb20 __se_sys_ioctl+0x6b/0xc0 do_syscall_64+0x7b/0x150 entry_SYSCALL_64_after_hwframe+0x76/0x7e
Impacted products
Vendor Product Version
Linux Linux Version: 94efde1d15399f5c88e576923db9bcd422d217f2
Version: 94efde1d15399f5c88e576923db9bcd422d217f2
Create a notification for this product.
   Linux Linux Version: 6.12
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "mm/gup.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "69d319450d1c651f3b05cd820ff285fdd810c032",
              "status": "affected",
              "version": "94efde1d15399f5c88e576923db9bcd422d217f2",
              "versionType": "git"
            },
            {
              "lessThan": "a1268be280d8e484ab3606d7476edd0f14bb9961",
              "status": "affected",
              "version": "94efde1d15399f5c88e576923db9bcd422d217f2",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "mm/gup.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.12"
            },
            {
              "lessThan": "6.12",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.5",
              "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/gup: handle NULL pages in unpin_user_pages()\n\nThe recent addition of \"pofs\" (pages or folios) handling to gup has a\nflaw: it assumes that unpin_user_pages() handles NULL pages in the pages**\narray.  That\u0027s not the case, as I discovered when I ran on a new\nconfiguration on my test machine.\n\nFix this by skipping NULL pages in unpin_user_pages(), just like\nunpin_folios() already does.\n\nDetails: when booting on x86 with \"numa=fake=2 movablecore=4G\" on Linux\n6.12, and running this:\n\n    tools/testing/selftests/mm/gup_longterm\n\n...I get the following crash:\n\nBUG: kernel NULL pointer dereference, address: 0000000000000008\nRIP: 0010:sanity_check_pinned_pages+0x3a/0x2d0\n...\nCall Trace:\n \u003cTASK\u003e\n ? __die_body+0x66/0xb0\n ? page_fault_oops+0x30c/0x3b0\n ? do_user_addr_fault+0x6c3/0x720\n ? irqentry_enter+0x34/0x60\n ? exc_page_fault+0x68/0x100\n ? asm_exc_page_fault+0x22/0x30\n ? sanity_check_pinned_pages+0x3a/0x2d0\n unpin_user_pages+0x24/0xe0\n check_and_migrate_movable_pages_or_folios+0x455/0x4b0\n __gup_longterm_locked+0x3bf/0x820\n ? mmap_read_lock_killable+0x12/0x50\n ? __pfx_mmap_read_lock_killable+0x10/0x10\n pin_user_pages+0x66/0xa0\n gup_test_ioctl+0x358/0xb20\n __se_sys_ioctl+0x6b/0xc0\n do_syscall_64+0x7b/0x150\n entry_SYSCALL_64_after_hwframe+0x76/0x7e"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-01-20T06:24:09.114Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/69d319450d1c651f3b05cd820ff285fdd810c032"
        },
        {
          "url": "https://git.kernel.org/stable/c/a1268be280d8e484ab3606d7476edd0f14bb9961"
        }
      ],
      "title": "mm/gup: handle NULL pages in unpin_user_pages()",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-56612",
    "datePublished": "2024-12-27T14:51:17.150Z",
    "dateReserved": "2024-12-27T14:03:06.013Z",
    "dateUpdated": "2025-01-20T06:24:09.114Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-56612\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-12-27T15:15:20.687\",\"lastModified\":\"2025-01-08T16:44:20.777\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmm/gup: handle NULL pages in unpin_user_pages()\\n\\nThe recent addition of \\\"pofs\\\" (pages or folios) handling to gup has a\\nflaw: it assumes that unpin_user_pages() handles NULL pages in the pages**\\narray.  That\u0027s not the case, as I discovered when I ran on a new\\nconfiguration on my test machine.\\n\\nFix this by skipping NULL pages in unpin_user_pages(), just like\\nunpin_folios() already does.\\n\\nDetails: when booting on x86 with \\\"numa=fake=2 movablecore=4G\\\" on Linux\\n6.12, and running this:\\n\\n    tools/testing/selftests/mm/gup_longterm\\n\\n...I get the following crash:\\n\\nBUG: kernel NULL pointer dereference, address: 0000000000000008\\nRIP: 0010:sanity_check_pinned_pages+0x3a/0x2d0\\n...\\nCall Trace:\\n \u003cTASK\u003e\\n ? __die_body+0x66/0xb0\\n ? page_fault_oops+0x30c/0x3b0\\n ? do_user_addr_fault+0x6c3/0x720\\n ? irqentry_enter+0x34/0x60\\n ? exc_page_fault+0x68/0x100\\n ? asm_exc_page_fault+0x22/0x30\\n ? sanity_check_pinned_pages+0x3a/0x2d0\\n unpin_user_pages+0x24/0xe0\\n check_and_migrate_movable_pages_or_folios+0x455/0x4b0\\n __gup_longterm_locked+0x3bf/0x820\\n ? mmap_read_lock_killable+0x12/0x50\\n ? __pfx_mmap_read_lock_killable+0x10/0x10\\n pin_user_pages+0x66/0xa0\\n gup_test_ioctl+0x358/0xb20\\n __se_sys_ioctl+0x6b/0xc0\\n do_syscall_64+0x7b/0x150\\n entry_SYSCALL_64_after_hwframe+0x76/0x7e\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm/gup: gestionar p\u00e1ginas NULL en unpin_user_pages() La reciente incorporaci\u00f3n dla gesti\u00f3n de \\\"pofs\\\" (p\u00e1ginas o folios) a gup tiene un defecto: supone que unpin_user_pages() gestiona p\u00e1ginas NULL en la matriz pages**. Ese no es el caso, como descubr\u00ed cuando ejecut\u00e9 una nueva configuraci\u00f3n en mi m\u00e1quina de prueba. Solucione esto omitiendo las p\u00e1ginas NULL en unpin_user_pages(), tal como ya lo hace unpin_folios(). Detalles: al arrancar en x86 con \\\"numa=fake=2 movablecore=4G\\\" en Linux 6.12, y ejecutar esto: tools/testing/selftests/mm/gup_longterm ... obtengo el siguiente fallo: ERROR: desreferencia de puntero NULL del n\u00facleo, direcci\u00f3n: 0000000000000008 RIP: 0010:sanity_check_pinned_pages+0x3a/0x2d0 ... Seguimiento de llamadas:  ? __die_body+0x66/0xb0 ? page_fault_oops+0x30c/0x3b0 ? do_user_addr_fault+0x6c3/0x720 ? irqentry_enter+0x34/0x60 ? exc_page_fault+0x68/0x100 ? asm_exc_page_fault+0x22/0x30 ? comprobaci\u00f3n de integridad de p\u00e1ginas fijadas+0x3a/0x2d0 desanclar p\u00e1ginas de usuario+0x24/0xe0 comprobar y migrar p\u00e1ginas o folios movibles+0x455/0x4b0 __gup_longterm_locked+0x3bf/0x820 ? mmap_read_lock_killable+0x12/0x50 ? __pfx_mmap_read_lock_killable+0x10/0x10 pin_usuario_p\u00e1ginas+0x66/0xa0 gup_test_ioctl+0x358/0xb20 __se_sys_ioctl+0x6b/0xc0 hacer_llamada_al_sistema_64+0x7b/0x150 entrada_SYSCALL_64_despu\u00e9s_de_hwframe+0x76/0x7e\"}],\"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\":\"CWE-476\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.12\",\"versionEndExcluding\":\"6.12.5\",\"matchCriteriaId\":\"2AF25791-E5D9-498F-AEA3-261AE0D30C3C\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"62567B3C-6CEE-46D0-BC2E-B3717FBF7D13\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/69d319450d1c651f3b05cd820ff285fdd810c032\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/a1268be280d8e484ab3606d7476edd0f14bb9961\",\"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.