cve-2024-35818
Vulnerability from cvelistv5
Published
2024-05-17 13:23
Modified
2024-08-02 03:21
Severity
Summary
LoongArch: Define the __io_aw() hook as mmiowb()
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-35818",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-17T17:39:17.575146Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-17T17:43:13.960Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T03:21:47.482Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/97cd43ba824aec764f5ea2790d0c0a318f885167"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/d7d7c6cdea875be3b241d7d39873bb431db7154d"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/0b61a7dc6712b78799b3949997e8a5e94db5c4b0"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/9adec248bba33b1503252caf8e59d81febfc5ceb"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/9c68ece8b2a5c5ff9b2fcaea923dd73efeb174cd"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/loongarch/include/asm/Kbuild",
            "arch/loongarch/include/asm/io.h",
            "arch/loongarch/include/asm/qspinlock.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "97cd43ba824a",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "d7d7c6cdea87",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "0b61a7dc6712",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "9adec248bba3",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "9c68ece8b2a5",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/loongarch/include/asm/Kbuild",
            "arch/loongarch/include/asm/io.h",
            "arch/loongarch/include/asm/qspinlock.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.84",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.24",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.7.*",
              "status": "unaffected",
              "version": "6.7.12",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.3",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.9",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: Define the __io_aw() hook as mmiowb()\n\nCommit fb24ea52f78e0d595852e (\"drivers: Remove explicit invocations of\nmmiowb()\") remove all mmiowb() in drivers, but it says:\n\n\"NOTE: mmiowb() has only ever guaranteed ordering in conjunction with\nspin_unlock(). However, pairing each mmiowb() removal in this patch with\nthe corresponding call to spin_unlock() is not at all trivial, so there\nis a small chance that this change may regress any drivers incorrectly\nrelying on mmiowb() to order MMIO writes between CPUs using lock-free\nsynchronisation.\"\n\nThe mmio in radeon_ring_commit() is protected by a mutex rather than a\nspinlock, but in the mutex fastpath it behaves similar to spinlock. We\ncan add mmiowb() calls in the radeon driver but the maintainer says he\ndoesn\u0027t like such a workaround, and radeon is not the only example of\nmutex protected mmio.\n\nSo we should extend the mmiowb tracking system from spinlock to mutex,\nand maybe other locking primitives. This is not easy and error prone, so\nwe solve it in the architectural code, by simply defining the __io_aw()\nhook as mmiowb(). And we no longer need to override queued_spin_unlock()\nso use the generic definition.\n\nWithout this, we get such an error when run \u0027glxgears\u0027 on weak ordering\narchitectures such as LoongArch:\n\nradeon 0000:04:00.0: ring 0 stalled for more than 10324msec\nradeon 0000:04:00.0: ring 3 stalled for more than 10240msec\nradeon 0000:04:00.0: GPU lockup (current fence id 0x000000000001f412 last fence id 0x000000000001f414 on ring 3)\nradeon 0000:04:00.0: GPU lockup (current fence id 0x000000000000f940 last fence id 0x000000000000f941 on ring 0)\nradeon 0000:04:00.0: scheduling IB failed (-35).\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\nradeon 0000:04:00.0: scheduling IB failed (-35).\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\nradeon 0000:04:00.0: scheduling IB failed (-35).\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\nradeon 0000:04:00.0: scheduling IB failed (-35).\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\nradeon 0000:04:00.0: scheduling IB failed (-35).\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\nradeon 0000:04:00.0: scheduling IB failed (-35).\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\nradeon 0000:04:00.0: scheduling IB failed (-35).\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-05-29T05:29:32.883Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/97cd43ba824aec764f5ea2790d0c0a318f885167"
        },
        {
          "url": "https://git.kernel.org/stable/c/d7d7c6cdea875be3b241d7d39873bb431db7154d"
        },
        {
          "url": "https://git.kernel.org/stable/c/0b61a7dc6712b78799b3949997e8a5e94db5c4b0"
        },
        {
          "url": "https://git.kernel.org/stable/c/9adec248bba33b1503252caf8e59d81febfc5ceb"
        },
        {
          "url": "https://git.kernel.org/stable/c/9c68ece8b2a5c5ff9b2fcaea923dd73efeb174cd"
        }
      ],
      "title": "LoongArch: Define the __io_aw() hook as mmiowb()",
      "x_generator": {
        "engine": "bippy-a5840b7849dd"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-35818",
    "datePublished": "2024-05-17T13:23:22.370Z",
    "dateReserved": "2024-05-17T12:19:12.343Z",
    "dateUpdated": "2024-08-02T03:21:47.482Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-35818\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-17T14:15:16.710\",\"lastModified\":\"2024-05-17T18:35:35.070\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nLoongArch: Define the __io_aw() hook as mmiowb()\\n\\nCommit fb24ea52f78e0d595852e (\\\"drivers: Remove explicit invocations of\\nmmiowb()\\\") remove all mmiowb() in drivers, but it says:\\n\\n\\\"NOTE: mmiowb() has only ever guaranteed ordering in conjunction with\\nspin_unlock(). However, pairing each mmiowb() removal in this patch with\\nthe corresponding call to spin_unlock() is not at all trivial, so there\\nis a small chance that this change may regress any drivers incorrectly\\nrelying on mmiowb() to order MMIO writes between CPUs using lock-free\\nsynchronisation.\\\"\\n\\nThe mmio in radeon_ring_commit() is protected by a mutex rather than a\\nspinlock, but in the mutex fastpath it behaves similar to spinlock. We\\ncan add mmiowb() calls in the radeon driver but the maintainer says he\\ndoesn\u0027t like such a workaround, and radeon is not the only example of\\nmutex protected mmio.\\n\\nSo we should extend the mmiowb tracking system from spinlock to mutex,\\nand maybe other locking primitives. This is not easy and error prone, so\\nwe solve it in the architectural code, by simply defining the __io_aw()\\nhook as mmiowb(). And we no longer need to override queued_spin_unlock()\\nso use the generic definition.\\n\\nWithout this, we get such an error when run \u0027glxgears\u0027 on weak ordering\\narchitectures such as LoongArch:\\n\\nradeon 0000:04:00.0: ring 0 stalled for more than 10324msec\\nradeon 0000:04:00.0: ring 3 stalled for more than 10240msec\\nradeon 0000:04:00.0: GPU lockup (current fence id 0x000000000001f412 last fence id 0x000000000001f414 on ring 3)\\nradeon 0000:04:00.0: GPU lockup (current fence id 0x000000000000f940 last fence id 0x000000000000f941 on ring 0)\\nradeon 0000:04:00.0: scheduling IB failed (-35).\\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\\nradeon 0000:04:00.0: scheduling IB failed (-35).\\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\\nradeon 0000:04:00.0: scheduling IB failed (-35).\\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\\nradeon 0000:04:00.0: scheduling IB failed (-35).\\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\\nradeon 0000:04:00.0: scheduling IB failed (-35).\\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\\nradeon 0000:04:00.0: scheduling IB failed (-35).\\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\\nradeon 0000:04:00.0: scheduling IB failed (-35).\\n[drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn\u0027t update BO_VA (-35)\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: LoongArch: define el gancho __io_aw() como mmiowb(). Confirmaci\u00f3n fb24ea52f78e0d595852e (\\\"drivers: elimina las invocaciones expl\u00edcitas de mmiowb()\\\") elimina todos los mmiowb() en los controladores, pero dice : \\\"NOTA: mmiowb() solo ha garantizado el pedido junto con spin_unlock(). Sin embargo, emparejar cada eliminaci\u00f3n de mmiowb() en este parche con la llamada correspondiente a spin_unlock() no es nada trivial, por lo que existe una peque\u00f1a posibilidad que este cambio puede hacer retroceder cualquier controlador que dependa incorrectamente de mmiowb() para ordenar escrituras MMIO entre CPU usando sincronizaci\u00f3n sin bloqueo\\\". El mmio en radeon_ring_commit() est\u00e1 protegido por un mutex en lugar de un spinlock, pero en el mutex fastpath se comporta de manera similar al spinlock. Podemos agregar llamadas mmiowb() en el controlador radeon, pero el mantenedor dice que no le gusta esa soluci\u00f3n, y radeon no es el \u00fanico ejemplo de mmio protegido por mutex. Entonces deber\u00edamos extender el sistema de seguimiento mmiowb de spinlock a mutex, y tal vez a otras primitivas de bloqueo. Esto no es f\u00e1cil y propenso a errores, por lo que lo solucionamos en el c\u00f3digo arquitect\u00f3nico, simplemente definiendo el gancho __io_aw() como mmiowb(). Y ya no necesitamos anular queued_spin_unlock() as\u00ed que use la definici\u00f3n gen\u00e9rica. Sin esto, obtenemos este error cuando ejecutamos \u0027glxgears\u0027 en arquitecturas de ordenamiento d\u00e9biles como LoongArch: radeon 0000:04:00.0: el anillo 0 se detuvo durante m\u00e1s de 10324 mseg radeon 0000:04:00.0: el anillo 3 se detuvo durante m\u00e1s de 10240 mseg radeon 0000:04:00.0: bloqueo de GPU (ID de valla actual 0x000000000001f412 ID de \u00faltima valla 0x000000000001f414 en el anillo 3) radeon 0000:04:00.0: Bloqueo de GPU (ID de valla actual 0x000000000000f940 ID de \u00faltima valla 0x000 000000000f941 en el anillo 0) radeon 0000:04:00.0: la programaci\u00f3n IB fall\u00f3 (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* No se pudo actualizar BO_VA (-35) radeon 0000:04:00.0: fall\u00f3 la programaci\u00f3n de IB (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* No se pudo actualizar BO_VA (-35) radeon 0000:04:00.0: fall\u00f3 la programaci\u00f3n de IB (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* No se pudo actualizar BO_VA (-35) radeon 0000:04:00.0: fall\u00f3 la programaci\u00f3n de IB (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* No se pudo actualizar BO_VA (-35) radeon 0000:04:00.0: fall\u00f3 la programaci\u00f3n de IB (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* No se pudo actualizar BO_VA (-35) radeon 0000:04:00.0: fall\u00f3 la programaci\u00f3n de IB (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* No se pudo actualizar BO_VA (-35) radeon 0000:04:00.0: fall\u00f3 la programaci\u00f3n de IB (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* No se pudo actualizar BO_VA (-35)\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/0b61a7dc6712b78799b3949997e8a5e94db5c4b0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/97cd43ba824aec764f5ea2790d0c0a318f885167\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9adec248bba33b1503252caf8e59d81febfc5ceb\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9c68ece8b2a5c5ff9b2fcaea923dd73efeb174cd\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d7d7c6cdea875be3b241d7d39873bb431db7154d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...