cve-2022-48797
Vulnerability from cvelistv5
Published
2024-07-16 11:43
Modified
2024-11-04 12:16
Severity ?
Summary
mm: don't try to NUMA-migrate COW pages that have other uses
Impacted products
Vendor Product Version
Linux Linux Version: 5.9
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-03T15:25:01.608Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2022-48797",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T16:59:16.178583Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:34:14.839Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "mm/mprotect.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "254090925e16",
              "status": "affected",
              "version": "09854ba94c6a",
              "versionType": "git"
            },
            {
              "lessThan": "b3dc4b9d3ca6",
              "status": "affected",
              "version": "09854ba94c6a",
              "versionType": "git"
            },
            {
              "lessThan": "d187eeb02d18",
              "status": "affected",
              "version": "09854ba94c6a",
              "versionType": "git"
            },
            {
              "lessThan": "80d47f5de5e3",
              "status": "affected",
              "version": "09854ba94c6a",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "mm/mprotect.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.9"
            },
            {
              "lessThan": "5.9",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.102",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.25",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.16.*",
              "status": "unaffected",
              "version": "5.16.11",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.17",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm: don\u0027t try to NUMA-migrate COW pages that have other uses\n\nOded Gabbay reports that enabling NUMA balancing causes corruption with\nhis Gaudi accelerator test load:\n\n \"All the details are in the bug, but the bottom line is that somehow,\n  this patch causes corruption when the numa balancing feature is\n  enabled AND we don\u0027t use process affinity AND we use GUP to pin pages\n  so our accelerator can DMA to/from system memory.\n\n  Either disabling numa balancing, using process affinity to bind to\n  specific numa-node or reverting this patch causes the bug to\n  disappear\"\n\nand Oded bisected the issue to commit 09854ba94c6a (\"mm: do_wp_page()\nsimplification\").\n\nNow, the NUMA balancing shouldn\u0027t actually be changing the writability\nof a page, and as such shouldn\u0027t matter for COW.  But it appears it\ndoes.  Suspicious.\n\nHowever, regardless of that, the condition for enabling NUMA faults in\nchange_pte_range() is nonsensical.  It uses \"page_mapcount(page)\" to\ndecide if a COW page should be NUMA-protected or not, and that makes\nabsolutely no sense.\n\nThe number of mappings a page has is irrelevant: not only does GUP get a\nreference to a page as in Oded\u0027s case, but the other mappings migth be\npaged out and the only reference to them would be in the page count.\n\nSince we should never try to NUMA-balance a page that we can\u0027t move\nanyway due to other references, just fix the code to use \u0027page_count()\u0027.\nOded confirms that that fixes his issue.\n\nNow, this does imply that something in NUMA balancing ends up changing\npage protections (other than the obvious one of making the page\ninaccessible to get the NUMA faulting information).  Otherwise the COW\nsimplification wouldn\u0027t matter - since doing the GUP on the page would\nmake sure it\u0027s writable.\n\nThe cause of that permission change would be good to figure out too,\nsince it clearly results in spurious COW events - but fixing the\nnonsensical test that just happened to work before is obviously the\nCorrectThing(tm) to do regardless."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-04T12:16:45.244Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3"
        },
        {
          "url": "https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849"
        },
        {
          "url": "https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea"
        },
        {
          "url": "https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6"
        }
      ],
      "title": "mm: don\u0027t try to NUMA-migrate COW pages that have other uses",
      "x_generator": {
        "engine": "bippy-9e1c9544281a"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-48797",
    "datePublished": "2024-07-16T11:43:51.547Z",
    "dateReserved": "2024-07-16T11:38:08.895Z",
    "dateUpdated": "2024-11-04T12:16:45.244Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-48797\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-07-16T12:15:04.360\",\"lastModified\":\"2024-11-21T07:34:02.710\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmm: don\u0027t try to NUMA-migrate COW pages that have other uses\\n\\nOded Gabbay reports that enabling NUMA balancing causes corruption with\\nhis Gaudi accelerator test load:\\n\\n \\\"All the details are in the bug, but the bottom line is that somehow,\\n  this patch causes corruption when the numa balancing feature is\\n  enabled AND we don\u0027t use process affinity AND we use GUP to pin pages\\n  so our accelerator can DMA to/from system memory.\\n\\n  Either disabling numa balancing, using process affinity to bind to\\n  specific numa-node or reverting this patch causes the bug to\\n  disappear\\\"\\n\\nand Oded bisected the issue to commit 09854ba94c6a (\\\"mm: do_wp_page()\\nsimplification\\\").\\n\\nNow, the NUMA balancing shouldn\u0027t actually be changing the writability\\nof a page, and as such shouldn\u0027t matter for COW.  But it appears it\\ndoes.  Suspicious.\\n\\nHowever, regardless of that, the condition for enabling NUMA faults in\\nchange_pte_range() is nonsensical.  It uses \\\"page_mapcount(page)\\\" to\\ndecide if a COW page should be NUMA-protected or not, and that makes\\nabsolutely no sense.\\n\\nThe number of mappings a page has is irrelevant: not only does GUP get a\\nreference to a page as in Oded\u0027s case, but the other mappings migth be\\npaged out and the only reference to them would be in the page count.\\n\\nSince we should never try to NUMA-balance a page that we can\u0027t move\\nanyway due to other references, just fix the code to use \u0027page_count()\u0027.\\nOded confirms that that fixes his issue.\\n\\nNow, this does imply that something in NUMA balancing ends up changing\\npage protections (other than the obvious one of making the page\\ninaccessible to get the NUMA faulting information).  Otherwise the COW\\nsimplification wouldn\u0027t matter - since doing the GUP on the page would\\nmake sure it\u0027s writable.\\n\\nThe cause of that permission change would be good to figure out too,\\nsince it clearly results in spurious COW events - but fixing the\\nnonsensical test that just happened to work before is obviously the\\nCorrectThing(tm) to do regardless.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm: no intente migrar p\u00e1ginas COW con NUMA que tengan otros usos Oded Gabbay informa que habilitar el equilibrio de NUMA causa corrupci\u00f3n en la carga de prueba del acelerador Gaud\u00ed: \\\"Todos los detalles est\u00e1n en el error, pero la conclusi\u00f3n es que de alguna manera, este parche causa corrupci\u00f3n cuando la funci\u00f3n de equilibrio numa est\u00e1 habilitada Y no usamos la afinidad de procesos Y usamos GUP para anclar p\u00e1ginas para que nuestro acelerador pueda DMA hacia/desde la memoria del sistema, ya sea deshabilitando. El equilibrio de numa, el uso de la afinidad del proceso para vincularse a un nodo numa espec\u00edfico o revertir este parche hace que el error desaparezca\\\" y Oded dividi\u00f3 el problema en dos para el commit 09854ba94c6a (\\\"mm: simplificaci\u00f3n de do_wp_page()\\\"). Ahora bien, el equilibrio NUMA en realidad no deber\u00eda cambiar la capacidad de escritura de una p\u00e1gina y, como tal, no deber\u00eda importarle a COW. Pero parece que s\u00ed. Sospechoso. Sin embargo, independientemente de eso, la condici\u00f3n para habilitar fallas NUMA en change_pte_range() no tiene sentido. Utiliza \\\"page_mapcount(page)\\\" para decidir si una p\u00e1gina COW debe estar protegida por NUMA o no, y eso no tiene ning\u00fan sentido. El n\u00famero de asignaciones que tiene una p\u00e1gina es irrelevante: GUP no solo obtiene una referencia a una p\u00e1gina como en el caso de Oded, sino que las otras asignaciones podr\u00edan eliminarse y la \u00fanica referencia a ellas estar\u00eda en el recuento de p\u00e1ginas. Dado que nunca debemos intentar equilibrar NUMA una p\u00e1gina que no podemos mover de todos modos debido a otras referencias, simplemente corrija el c\u00f3digo para usar \u0027page_count()\u0027. Oded confirma que eso soluciona su problema. Ahora bien, esto implica que algo en el equilibrio de NUMA termina cambiando las protecciones de la p\u00e1gina (aparte de la obvia de hacer que la p\u00e1gina sea inaccesible para obtener la informaci\u00f3n de fallas de NUMA). De lo contrario, la simplificaci\u00f3n de COW no importar\u00eda, ya que hacer el GUP en la p\u00e1gina garantizar\u00eda que se pueda escribir. Tambi\u00e9n ser\u00eda bueno descubrir la causa de ese cambio de permiso, ya que claramente da como resultado eventos COW falsos, pero arreglar la prueba sin sentido que funcion\u00f3 antes es obviamente lo CorrectThing(tm) que se debe hacer de todos modos.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea\",\"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.