{
   "containers": {
      "cna": {
         "providerMetadata": {
            "orgId": "f4215fc3-5b6b-47ff-a258-f7189bd81038"
         },
         "descriptions": [
            {
               "lang": "en",
               "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/gup: fix memfd_pin_folios alloc race panic\n\nIf memfd_pin_folios tries to create a hugetlb page, but someone else\nalready did, then folio gets the value -EEXIST here:\n\n        folio = memfd_alloc_folio(memfd, start_idx);\n        if (IS_ERR(folio)) {\n                ret = PTR_ERR(folio);\n                if (ret != -EEXIST)\n                        goto err;\n\nthen on the next trip through the \"while start_idx\" loop we panic here:\n\n        if (folio) {\n                folio_put(folio);\n\nTo fix, set the folio to NULL on error."
            }
         ],
         "affected": [
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "unaffected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "programFiles": [
                  "mm/gup.c"
               ],
               "versions": [
                  {
                     "version": "89c1905d9c14",
                     "lessThan": "e28f39b359c0",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "89c1905d9c14",
                     "lessThan": "ce645b9fdc78",
                     "status": "affected",
                     "versionType": "git"
                  }
               ]
            },
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "affected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "programFiles": [
                  "mm/gup.c"
               ],
               "versions": [
                  {
                     "version": "6.11",
                     "status": "affected"
                  },
                  {
                     "version": "0",
                     "lessThan": "6.11",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.11.3",
                     "lessThanOrEqual": "6.11.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.12-rc1",
                     "lessThanOrEqual": "*",
                     "status": "unaffected",
                     "versionType": "original_commit_for_fix"
                  }
               ]
            }
         ],
         "references": [
            {
               "url": "https://git.kernel.org/stable/c/e28f39b359c0cfdcc011603e51187085a5f1e5e3"
            },
            {
               "url": "https://git.kernel.org/stable/c/ce645b9fdc78ec5d28067286e92871ddae6817d5"
            }
         ],
         "title": "mm/gup: fix memfd_pin_folios alloc race panic",
         "x_generator": {
            "engine": "bippy-c9c4e1df01b2"
         }
      }
   },
   "cveMetadata": {
      "assignerOrgId": "f4215fc3-5b6b-47ff-a258-f7189bd81038",
      "cveID": "CVE-2024-49872",
      "requesterUserId": "gregkh@kernel.org",
      "serial": "1",
      "state": "PUBLISHED"
   },
   "dataType": "CVE_RECORD",
   "dataVersion": "5.0"
}
