cve-2023-52739
Vulnerability from cvelistv5
Published
2024-05-21 15:23
Modified
2024-12-19 08:24
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: Fix page corruption caused by racy check in __free_pages When we upgraded our kernel, we started seeing some page corruption like the following consistently: BUG: Bad page state in process ganesha.nfsd pfn:1304ca page:0000000022261c55 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x1304ca flags: 0x17ffffc0000000() raw: 0017ffffc0000000 ffff8a513ffd4c98 ffffeee24b35ec08 0000000000000000 raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000 page dumped because: nonzero mapcount CPU: 0 PID: 15567 Comm: ganesha.nfsd Kdump: loaded Tainted: P B O 5.10.158-1.nutanix.20221209.el7.x86_64 #1 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016 Call Trace: dump_stack+0x74/0x96 bad_page.cold+0x63/0x94 check_new_page_bad+0x6d/0x80 rmqueue+0x46e/0x970 get_page_from_freelist+0xcb/0x3f0 ? _cond_resched+0x19/0x40 __alloc_pages_nodemask+0x164/0x300 alloc_pages_current+0x87/0xf0 skb_page_frag_refill+0x84/0x110 ... Sometimes, it would also show up as corruption in the free list pointer and cause crashes. After bisecting the issue, we found the issue started from commit e320d3012d25 ("mm/page_alloc.c: fix freeing non-compound pages"): if (put_page_testzero(page)) free_the_page(page, order); else if (!PageHead(page)) while (order-- > 0) free_the_page(page + (1 << order), order); So the problem is the check PageHead is racy because at this point we already dropped our reference to the page. So even if we came in with compound page, the page can already be freed and PageHead can return false and we will end up freeing all the tail pages causing double free.
Impacted products
Vendor Product Version
Linux Linux Version: 5.10
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T23:11:35.988Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/0a626e27f984dfbe96bd8e4fd08f20a2ede3ea23"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/3af734f3eac6f70ef8e272a80da40544b9d0f2b5"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/3b4c045a98f53a8890a94bb5846a390c8e39e673"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/462a8e08e0e6287e5ce13187257edbf24213ed03"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2023-52739",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T15:37:31.888561Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:33:35.029Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "mm/page_alloc.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "0a626e27f984dfbe96bd8e4fd08f20a2ede3ea23",
              "status": "affected",
              "version": "e320d3012d25b1fb5f3df4edb7bd44a1c362ec10",
              "versionType": "git"
            },
            {
              "lessThan": "3af734f3eac6f70ef8e272a80da40544b9d0f2b5",
              "status": "affected",
              "version": "e320d3012d25b1fb5f3df4edb7bd44a1c362ec10",
              "versionType": "git"
            },
            {
              "lessThan": "3b4c045a98f53a8890a94bb5846a390c8e39e673",
              "status": "affected",
              "version": "e320d3012d25b1fb5f3df4edb7bd44a1c362ec10",
              "versionType": "git"
            },
            {
              "lessThan": "462a8e08e0e6287e5ce13187257edbf24213ed03",
              "status": "affected",
              "version": "e320d3012d25b1fb5f3df4edb7bd44a1c362ec10",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "mm/page_alloc.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.10"
            },
            {
              "lessThan": "5.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.168",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.94",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.12",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.2",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nFix page corruption caused by racy check in __free_pages\n\nWhen we upgraded our kernel, we started seeing some page corruption like\nthe following consistently:\n\n  BUG: Bad page state in process ganesha.nfsd  pfn:1304ca\n  page:0000000022261c55 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x1304ca\n  flags: 0x17ffffc0000000()\n  raw: 0017ffffc0000000 ffff8a513ffd4c98 ffffeee24b35ec08 0000000000000000\n  raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000\n  page dumped because: nonzero mapcount\n  CPU: 0 PID: 15567 Comm: ganesha.nfsd Kdump: loaded Tainted: P    B      O      5.10.158-1.nutanix.20221209.el7.x86_64 #1\n  Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016\n  Call Trace:\n   dump_stack+0x74/0x96\n   bad_page.cold+0x63/0x94\n   check_new_page_bad+0x6d/0x80\n   rmqueue+0x46e/0x970\n   get_page_from_freelist+0xcb/0x3f0\n   ? _cond_resched+0x19/0x40\n   __alloc_pages_nodemask+0x164/0x300\n   alloc_pages_current+0x87/0xf0\n   skb_page_frag_refill+0x84/0x110\n   ...\n\nSometimes, it would also show up as corruption in the free list pointer\nand cause crashes.\n\nAfter bisecting the issue, we found the issue started from commit\ne320d3012d25 (\"mm/page_alloc.c: fix freeing non-compound pages\"):\n\n\tif (put_page_testzero(page))\n\t\tfree_the_page(page, order);\n\telse if (!PageHead(page))\n\t\twhile (order-- \u003e 0)\n\t\t\tfree_the_page(page + (1 \u003c\u003c order), order);\n\nSo the problem is the check PageHead is racy because at this point we\nalready dropped our reference to the page.  So even if we came in with\ncompound page, the page can already be freed and PageHead can return\nfalse and we will end up freeing all the tail pages causing double free."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-12-19T08:24:45.438Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/0a626e27f984dfbe96bd8e4fd08f20a2ede3ea23"
        },
        {
          "url": "https://git.kernel.org/stable/c/3af734f3eac6f70ef8e272a80da40544b9d0f2b5"
        },
        {
          "url": "https://git.kernel.org/stable/c/3b4c045a98f53a8890a94bb5846a390c8e39e673"
        },
        {
          "url": "https://git.kernel.org/stable/c/462a8e08e0e6287e5ce13187257edbf24213ed03"
        }
      ],
      "title": "Fix page corruption caused by racy check in __free_pages",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-52739",
    "datePublished": "2024-05-21T15:23:02.545Z",
    "dateReserved": "2024-05-21T15:19:24.233Z",
    "dateUpdated": "2024-12-19T08:24:45.438Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2023-52739\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-21T16:15:13.820\",\"lastModified\":\"2024-11-21T08:40:29.020\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nFix page corruption caused by racy check in __free_pages\\n\\nWhen we upgraded our kernel, we started seeing some page corruption like\\nthe following consistently:\\n\\n  BUG: Bad page state in process ganesha.nfsd  pfn:1304ca\\n  page:0000000022261c55 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x1304ca\\n  flags: 0x17ffffc0000000()\\n  raw: 0017ffffc0000000 ffff8a513ffd4c98 ffffeee24b35ec08 0000000000000000\\n  raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000\\n  page dumped because: nonzero mapcount\\n  CPU: 0 PID: 15567 Comm: ganesha.nfsd Kdump: loaded Tainted: P    B      O      5.10.158-1.nutanix.20221209.el7.x86_64 #1\\n  Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016\\n  Call Trace:\\n   dump_stack+0x74/0x96\\n   bad_page.cold+0x63/0x94\\n   check_new_page_bad+0x6d/0x80\\n   rmqueue+0x46e/0x970\\n   get_page_from_freelist+0xcb/0x3f0\\n   ? _cond_resched+0x19/0x40\\n   __alloc_pages_nodemask+0x164/0x300\\n   alloc_pages_current+0x87/0xf0\\n   skb_page_frag_refill+0x84/0x110\\n   ...\\n\\nSometimes, it would also show up as corruption in the free list pointer\\nand cause crashes.\\n\\nAfter bisecting the issue, we found the issue started from commit\\ne320d3012d25 (\\\"mm/page_alloc.c: fix freeing non-compound pages\\\"):\\n\\n\\tif (put_page_testzero(page))\\n\\t\\tfree_the_page(page, order);\\n\\telse if (!PageHead(page))\\n\\t\\twhile (order-- \u003e 0)\\n\\t\\t\\tfree_the_page(page + (1 \u003c\u003c order), order);\\n\\nSo the problem is the check PageHead is racy because at this point we\\nalready dropped our reference to the page.  So even if we came in with\\ncompound page, the page can already be freed and PageHead can return\\nfalse and we will end up freeing all the tail pages causing double free.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: Repare la corrupci\u00f3n de la p\u00e1gina causada por el control racy en __free_pages. Cuando actualizamos nuestro kernel, comenzamos a ver algunos da\u00f1os en la p\u00e1gina como los siguientes de manera consistente: ERROR: Estado incorrecto de la p\u00e1gina en el proceso ganesha.nfsd pfn: 1304ca p\u00e1gina:0000000022261c55 refcount:0 mapcount:-128 mapeo:0000000000000000 \u00edndice:0x0 pfn:0x1304ca banderas: 0x17ffffc0000000() raw: 0017ffffc0000000 ffff8a513ffd4c98 24b35ec08 0000000000000000 raw: 00000000000000000 0000000000000001 00000000ffffff7f 00000000000000000 p\u00e1gina volcada porque: recuento de mapas distinto de cero CPU: 0 PID: 15567 Comm : ganesha.nfsd Kdump: cargado Contaminado: PBO 5.10.158-1.nutanix.20221209.el7.x86_64 #1 Nombre del hardware: VMware, Inc. Plataforma virtual VMware/Plataforma de referencia de escritorio 440BX, BIOS 6.00 05/04/2016 Seguimiento de llamadas : dump_stack+0x74/0x96 bad_page.cold+0x63/0x94 check_new_page_bad+0x6d/0x80 rmqueue+0x46e/0x970 get_page_from_freelist+0xcb/0x3f0 ? _cond_resched+0x19/0x40 __alloc_pages_nodemask+0x164/0x300 alloc_pages_current+0x87/0xf0 skb_page_frag_refill+0x84/0x110 ... A veces, tambi\u00e9n aparecer\u00eda como corrupci\u00f3n en el puntero de la lista libre y provocar\u00eda fallos. Despu\u00e9s de dividir el problema en dos, encontramos que el problema comenz\u00f3 desde la confirmaci\u00f3n e320d3012d25 (\\\"mm/page_alloc.c: corrige la liberaci\u00f3n de p\u00e1ginas no compuestas\\\"): if (put_page_testzero(page)) free_the_page(page, order); else if (!PageHead(p\u00e1gina)) while (orden-- \u0026gt; 0) free_the_page(p\u00e1gina + (1 \u0026lt;\u0026lt; orden), orden); Entonces, el problema es que la verificaci\u00f3n PageHead es picante porque en este punto ya eliminamos nuestra referencia a la p\u00e1gina. Entonces, incluso si ingresamos con una p\u00e1gina compuesta, la p\u00e1gina ya se puede liberar y PageHead puede devolver falso y terminaremos liberando todas las p\u00e1ginas finales causando un double free.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/0a626e27f984dfbe96bd8e4fd08f20a2ede3ea23\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/3af734f3eac6f70ef8e272a80da40544b9d0f2b5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/3b4c045a98f53a8890a94bb5846a390c8e39e673\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/462a8e08e0e6287e5ce13187257edbf24213ed03\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/0a626e27f984dfbe96bd8e4fd08f20a2ede3ea23\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/3af734f3eac6f70ef8e272a80da40544b9d0f2b5\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/3b4c045a98f53a8890a94bb5846a390c8e39e673\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/462a8e08e0e6287e5ce13187257edbf24213ed03\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}"
  }
}


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.