cve-2024-40979
Vulnerability from cvelistv5
Published
2024-07-12 12:32
Modified
2024-11-29 10:54
Severity ?
Summary
wifi: ath12k: fix kernel crash during resume
Impacted products
Vendor Product Version
Linux Linux Version: 6.3
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T04:39:55.885Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/bb50a4e711ff95348ad53641acb1306d89eb4c3a"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/303c017821d88ebad887814114d4e5966d320b28"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-40979",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T17:02:27.015778Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:34:21.625Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/wireless/ath/ath12k/core.c",
            "drivers/net/wireless/ath/ath12k/qmi.c",
            "drivers/net/wireless/ath/ath12k/qmi.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "bb50a4e711ff",
              "status": "affected",
              "version": "d889913205cf",
              "versionType": "git"
            },
            {
              "lessThan": "303c017821d8",
              "status": "affected",
              "version": "d889913205cf",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/wireless/ath/ath12k/core.c",
            "drivers/net/wireless/ath/ath12k/qmi.c",
            "drivers/net/wireless/ath/ath12k/qmi.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.3"
            },
            {
              "lessThan": "6.3",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.9.*",
              "status": "unaffected",
              "version": "6.9.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.10",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: ath12k: fix kernel crash during resume\n\nCurrently during resume, QMI target memory is not properly handled, resulting\nin kernel crash in case DMA remap is not supported:\n\nBUG: Bad page state in process kworker/u16:54  pfn:36e80\npage: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36e80\npage dumped because: nonzero _refcount\nCall Trace:\n bad_page\n free_page_is_bad_report\n __free_pages_ok\n __free_pages\n dma_direct_free\n dma_free_attrs\n ath12k_qmi_free_target_mem_chunk\n ath12k_qmi_msg_mem_request_cb\n\nThe reason is:\nOnce ath12k module is loaded, firmware sends memory request to host. In case\nDMA remap not supported, ath12k refuses the first request due to failure in\nallocating with large segment size:\n\nath12k_pci 0000:04:00.0: qmi firmware request memory request\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 7077888\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 8454144\nath12k_pci 0000:04:00.0: qmi dma allocation failed (7077888 B type 1), will try later with small size\nath12k_pci 0000:04:00.0: qmi delays mem_request 2\nath12k_pci 0000:04:00.0: qmi firmware request memory request\n\nLater firmware comes back with more but small segments and allocation\nsucceeds:\n\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 262144\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 65536\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\n\nNow ath12k is working. If suspend is triggered, firmware will be reloaded\nduring resume. As same as before, firmware requests two large segments at\nfirst. In ath12k_qmi_msg_mem_request_cb() segment count and size are\nassigned:\n\n\tab-\u003eqmi.mem_seg_count == 2\n\tab-\u003eqmi.target_mem[0].size == 7077888\n\tab-\u003eqmi.target_mem[1].size == 8454144\n\nThen allocation failed like before and ath12k_qmi_free_target_mem_chunk()\nis called to free all allocated segments. Note the first segment is skipped\nbecause its v.addr is cleared due to allocation failure:\n\n\tchunk-\u003ev.addr = dma_alloc_coherent()\n\nAlso note that this leaks that segment because it has not been freed.\n\nWhile freeing the second segment, a size of 8454144 is passed to\ndma_free_coherent(). However remember that this segment is allocated at\nthe first time firmware is loaded, before suspend. So its real size is\n524288, much smaller than 8454144. As a result kernel found we are freeing\nsome memory which is in use and thus cras\n---truncated---"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-29T10:54:40.798Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/bb50a4e711ff95348ad53641acb1306d89eb4c3a"
        },
        {
          "url": "https://git.kernel.org/stable/c/303c017821d88ebad887814114d4e5966d320b28"
        }
      ],
      "title": "wifi: ath12k: fix kernel crash during resume",
      "x_generator": {
        "engine": "bippy-8e903de6a542"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-40979",
    "datePublished": "2024-07-12T12:32:14.902Z",
    "dateReserved": "2024-07-12T12:17:45.604Z",
    "dateUpdated": "2024-11-29T10:54:40.798Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-40979\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-07-12T13:15:19.477\",\"lastModified\":\"2024-11-21T09:31:59.700\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nwifi: ath12k: fix kernel crash during resume\\n\\nCurrently during resume, QMI target memory is not properly handled, resulting\\nin kernel crash in case DMA remap is not supported:\\n\\nBUG: Bad page state in process kworker/u16:54  pfn:36e80\\npage: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36e80\\npage dumped because: nonzero _refcount\\nCall Trace:\\n bad_page\\n free_page_is_bad_report\\n __free_pages_ok\\n __free_pages\\n dma_direct_free\\n dma_free_attrs\\n ath12k_qmi_free_target_mem_chunk\\n ath12k_qmi_msg_mem_request_cb\\n\\nThe reason is:\\nOnce ath12k module is loaded, firmware sends memory request to host. In case\\nDMA remap not supported, ath12k refuses the first request due to failure in\\nallocating with large segment size:\\n\\nath12k_pci 0000:04:00.0: qmi firmware request memory request\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 7077888\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 8454144\\nath12k_pci 0000:04:00.0: qmi dma allocation failed (7077888 B type 1), will try later with small size\\nath12k_pci 0000:04:00.0: qmi delays mem_request 2\\nath12k_pci 0000:04:00.0: qmi firmware request memory request\\n\\nLater firmware comes back with more but small segments and allocation\\nsucceeds:\\n\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 262144\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288\\nath12k_pci 0000:04:00.0: qmi mem seg type 4 size 65536\\nath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288\\n\\nNow ath12k is working. If suspend is triggered, firmware will be reloaded\\nduring resume. As same as before, firmware requests two large segments at\\nfirst. In ath12k_qmi_msg_mem_request_cb() segment count and size are\\nassigned:\\n\\n\\tab-\u003eqmi.mem_seg_count == 2\\n\\tab-\u003eqmi.target_mem[0].size == 7077888\\n\\tab-\u003eqmi.target_mem[1].size == 8454144\\n\\nThen allocation failed like before and ath12k_qmi_free_target_mem_chunk()\\nis called to free all allocated segments. Note the first segment is skipped\\nbecause its v.addr is cleared due to allocation failure:\\n\\n\\tchunk-\u003ev.addr = dma_alloc_coherent()\\n\\nAlso note that this leaks that segment because it has not been freed.\\n\\nWhile freeing the second segment, a size of 8454144 is passed to\\ndma_free_coherent(). However remember that this segment is allocated at\\nthe first time firmware is loaded, before suspend. So its real size is\\n524288, much smaller than 8454144. As a result kernel found we are freeing\\nsome memory which is in use and thus cras\\n---truncated---\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: wifi: ath12k: soluciona el fallo del kernel durante la reanudaci\u00f3n Actualmente, durante la reanudaci\u00f3n, la memoria de destino de QMI no se maneja adecuadamente, lo que provoca un fallo del kernel en caso de que no se admita la reasignaci\u00f3n de DMA: ERROR: Estado incorrecto de la p\u00e1gina en proceso kworker/u16:54 pfn:36e80 p\u00e1gina: refcount:1 mapcount:0 mapeo:0000000000000000 index:0x0 pfn:0x36e80 p\u00e1gina descargada porque: distinto de cero _refcount Rastreo de llamadas: bad_page free_page_is_bad_report __free_pages_ok __free_pages dma_direct_free dma_free_attrs a th12k_qmi_free_target_mem_chunk ath12k_qmi_msg_mem_request_cb El motivo es: Una vez ath12k El m\u00f3dulo est\u00e1 cargado, el firmware env\u00eda la solicitud de memoria al host. En caso de que no se admita la reasignaci\u00f3n de DMA, ath12k rechaza la primera solicitud debido a un error en la asignaci\u00f3n con un tama\u00f1o de segmento grande: ath12k_pci 0000:04:00.0: solicitud de firmware qmi solicitud de memoria ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 7077888 ath12k_pci 0000 :04:00.0: qmi mem seg tipo 4 tama\u00f1o 8454144 ath12k_pci 0000:04:00.0: falla en la asignaci\u00f3n de qmi dma (7077888 B tipo 1), lo intentar\u00e9 m\u00e1s tarde con un tama\u00f1o peque\u00f1o ath12k_pci 0000:04:00.0: qmi retrasa mem_request 2 ath12k_pci 0000: 04:00.0: solicitud de memoria de solicitud de firmware qmi El firmware posterior regresa con m\u00e1s segmentos, pero peque\u00f1os, y la asignaci\u00f3n se realiza correctamente: ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 pci 0000:04:00.0:qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 262144 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000 :04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00 .0: segmento de memoria qmi tipo 1 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 24288 ath12k_pci 0000:04 :00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 5242 88 ath12k_pci 0000:04:00.0 : qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem se g tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 524288 ath12k_pci 0000:04:00.0: qmi mem seg tipo 4 tama\u00f1o 65536 ci 0000:04:00.0: qmi mem seg tipo 1 tama\u00f1o 524288 Ahora ath12k est\u00e1 funcionando. Si se activa la suspensi\u00f3n, el firmware se recargar\u00e1 durante la reanudaci\u00f3n. Al igual que antes, el firmware solicita dos segmentos grandes al principio. En ath12k_qmi_msg_mem_request_cb() se asigna el recuento y el tama\u00f1o del segmento: ab-\u0026gt;qmi.mem_seg_count == 2 ab-\u0026gt;qmi.target_mem[0].size == 7077888 ab-\u0026gt;qmi.target_mem[1].size == 8454144 Luego, la asignaci\u00f3n fall\u00f3 como antes y se llama a ath12k_qmi_free_target_mem_chunk() para liberar todos los segmentos asignados. ---truncado---\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/303c017821d88ebad887814114d4e5966d320b28\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/bb50a4e711ff95348ad53641acb1306d89eb4c3a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/303c017821d88ebad887814114d4e5966d320b28\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/bb50a4e711ff95348ad53641acb1306d89eb4c3a\",\"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.