cve-2024-53071
Vulnerability from cvelistv5
Published
2024-11-19 17:22
Modified
2024-11-19 17:22
Severity ?
Summary
drm/panthor: Be stricter about IO mapping flags
Impacted products
Vendor Product Version
Linux Linux Version: 6.10
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpu/drm/panthor/panthor_device.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "2604afd65043",
              "status": "affected",
              "version": "5fe909cae118",
              "versionType": "git"
            },
            {
              "lessThan": "f432a1621f04",
              "status": "affected",
              "version": "5fe909cae118",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpu/drm/panthor/panthor_device.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.10"
            },
            {
              "lessThan": "6.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.11.*",
              "status": "unaffected",
              "version": "6.11.8",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.12",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/panthor: Be stricter about IO mapping flags\n\nThe current panthor_device_mmap_io() implementation has two issues:\n\n1. For mapping DRM_PANTHOR_USER_FLUSH_ID_MMIO_OFFSET,\n   panthor_device_mmap_io() bails if VM_WRITE is set, but does not clear\n   VM_MAYWRITE. That means userspace can use mprotect() to make the mapping\n   writable later on. This is a classic Linux driver gotcha.\n   I don\u0027t think this actually has any impact in practice:\n   When the GPU is powered, writes to the FLUSH_ID seem to be ignored; and\n   when the GPU is not powered, the dummy_latest_flush page provided by the\n   driver is deliberately designed to not do any flushes, so the only thing\n   writing to the dummy_latest_flush could achieve would be to make *more*\n   flushes happen.\n\n2. panthor_device_mmap_io() does not block MAP_PRIVATE mappings (which are\n   mappings without the VM_SHARED flag).\n   MAP_PRIVATE in combination with VM_MAYWRITE indicates that the VMA has\n   copy-on-write semantics, which for VM_PFNMAP are semi-supported but\n   fairly cursed.\n   In particular, in such a mapping, the driver can only install PTEs\n   during mmap() by calling remap_pfn_range() (because remap_pfn_range()\n   wants to **store the physical address of the mapped physical memory into\n   the vm_pgoff of the VMA**); installing PTEs later on with a fault\n   handler (as panthor does) is not supported in private mappings, and so\n   if you try to fault in such a mapping, vmf_insert_pfn_prot() splats when\n   it hits a BUG() check.\n\nFix it by clearing the VM_MAYWRITE flag (userspace writing to the FLUSH_ID\ndoesn\u0027t make sense) and requiring VM_SHARED (copy-on-write semantics for\nthe FLUSH_ID don\u0027t make sense).\n\nReproducers for both scenarios are in the notes of my patch on the mailing\nlist; I tested that these bugs exist on a Rock 5B machine.\n\nNote that I only compile-tested the patch, I haven\u0027t tested it; I don\u0027t\nhave a working kernel build setup for the test machine yet. Please test it\nbefore applying it."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-19T17:22:38.327Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/2604afd65043e8f9d4be036cb1242adf6b5723cf"
        },
        {
          "url": "https://git.kernel.org/stable/c/f432a1621f049bb207e78363d9d0e3c6fa2da5db"
        }
      ],
      "title": "drm/panthor: Be stricter about IO mapping flags",
      "x_generator": {
        "engine": "bippy-8e903de6a542"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-53071",
    "datePublished": "2024-11-19T17:22:38.327Z",
    "dateReserved": "2024-11-19T17:17:24.976Z",
    "dateUpdated": "2024-11-19T17:22:38.327Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-53071\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-11-19T18:15:26.793\",\"lastModified\":\"2024-11-26T22:18:28.540\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ndrm/panthor: Be stricter about IO mapping flags\\n\\nThe current panthor_device_mmap_io() implementation has two issues:\\n\\n1. For mapping DRM_PANTHOR_USER_FLUSH_ID_MMIO_OFFSET,\\n   panthor_device_mmap_io() bails if VM_WRITE is set, but does not clear\\n   VM_MAYWRITE. That means userspace can use mprotect() to make the mapping\\n   writable later on. This is a classic Linux driver gotcha.\\n   I don\u0027t think this actually has any impact in practice:\\n   When the GPU is powered, writes to the FLUSH_ID seem to be ignored; and\\n   when the GPU is not powered, the dummy_latest_flush page provided by the\\n   driver is deliberately designed to not do any flushes, so the only thing\\n   writing to the dummy_latest_flush could achieve would be to make *more*\\n   flushes happen.\\n\\n2. panthor_device_mmap_io() does not block MAP_PRIVATE mappings (which are\\n   mappings without the VM_SHARED flag).\\n   MAP_PRIVATE in combination with VM_MAYWRITE indicates that the VMA has\\n   copy-on-write semantics, which for VM_PFNMAP are semi-supported but\\n   fairly cursed.\\n   In particular, in such a mapping, the driver can only install PTEs\\n   during mmap() by calling remap_pfn_range() (because remap_pfn_range()\\n   wants to **store the physical address of the mapped physical memory into\\n   the vm_pgoff of the VMA**); installing PTEs later on with a fault\\n   handler (as panthor does) is not supported in private mappings, and so\\n   if you try to fault in such a mapping, vmf_insert_pfn_prot() splats when\\n   it hits a BUG() check.\\n\\nFix it by clearing the VM_MAYWRITE flag (userspace writing to the FLUSH_ID\\ndoesn\u0027t make sense) and requiring VM_SHARED (copy-on-write semantics for\\nthe FLUSH_ID don\u0027t make sense).\\n\\nReproducers for both scenarios are in the notes of my patch on the mailing\\nlist; I tested that these bugs exist on a Rock 5B machine.\\n\\nNote that I only compile-tested the patch, I haven\u0027t tested it; I don\u0027t\\nhave a working kernel build setup for the test machine yet. Please test it\\nbefore applying it.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: drm/panthor: Sea m\u00e1s estricto con las banderas de mapeo de IO La implementaci\u00f3n actual de panthor_device_mmap_io() tiene dos problemas: 1. Para mapear DRM_PANTHOR_USER_FLUSH_ID_MMIO_OFFSET, panthor_device_mmap_io() abandona si VM_WRITE est\u00e1 configurado, pero no borra VM_MAYWRITE. Eso significa que el espacio de usuario puede usar mprotect() para hacer que el mapeo sea escribible m\u00e1s tarde. Este es un problema cl\u00e1sico del controlador de Linux. No creo que esto realmente tenga alg\u00fan impacto en la pr\u00e1ctica: cuando la GPU est\u00e1 encendida, las escrituras en FLUSH_ID parecen ignorarse; y cuando la GPU no est\u00e1 encendida, la p\u00e1gina dummy_latest_flush proporcionada por el controlador est\u00e1 dise\u00f1ada deliberadamente para no hacer ning\u00fan vaciado, por lo que lo \u00fanico que escribir en dummy_latest_flush podr\u00eda lograr ser\u00eda hacer que ocurrieran *m\u00e1s* vaciados. 2. panthor_device_mmap_io() no bloquea las asignaciones MAP_PRIVATE (que son asignaciones sin el indicador VM_SHARED). MAP_PRIVATE en combinaci\u00f3n con VM_MAYWRITE indica que la VMA tiene sem\u00e1ntica de copia en escritura, que para VM_PFNMAP son semicompatibles pero con bastante mala calidad. En particular, en una asignaci\u00f3n de este tipo, el controlador solo puede instalar PTE durante mmap() llamando a remap_pfn_range() (porque remap_pfn_range() quiere **almacenar la direcci\u00f3n f\u00edsica de la memoria f\u00edsica asignada en el vm_pgoff de la VMA**); la instalaci\u00f3n de PTE m\u00e1s tarde con un controlador de errores (como lo hace panthor) no se admite en asignaciones privadas y, por lo tanto, si intenta generar un error en una asignaci\u00f3n de este tipo, vmf_insert_pfn_prot() se bloquea cuando llega a una comprobaci\u00f3n de ERROR(). Arr\u00e9glelo borrando la marca VM_MAYWRITE (la escritura en el espacio de usuario en FLUSH_ID no tiene sentido) y requiriendo VM_SHARED (la sem\u00e1ntica de copia en escritura para FLUSH_ID no tiene sentido). Los reproductores para ambos escenarios est\u00e1n en las notas de mi parche en la lista de correo; prob\u00e9 que estos errores existen en una m\u00e1quina Rock 5B. Tenga en cuenta que solo prob\u00e9 la compilaci\u00f3n del parche, no lo he probado; a\u00fan no tengo una configuraci\u00f3n de compilaci\u00f3n de kernel que funcione para la m\u00e1quina de prueba. Pru\u00e9belo antes de aplicarlo.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.10\",\"versionEndExcluding\":\"6.11.8\",\"matchCriteriaId\":\"ECA7D13C-A6AD-4239-BDEF-6B70FF23A4A9\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"7F361E1D-580F-4A2D-A509-7615F73167A1\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"925478D0-3E3D-4E6F-ACD5-09F28D5DF82C\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"3C95E234-D335-4B6C-96BF-E2CEBD8654ED\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc4:*:*:*:*:*:*\",\"matchCriteriaId\":\"E0F717D8-3014-4F84-8086-0124B2111379\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc5:*:*:*:*:*:*\",\"matchCriteriaId\":\"24DBE6C7-2AAE-4818-AED2-E131F153D2FA\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc6:*:*:*:*:*:*\",\"matchCriteriaId\":\"24B88717-53F5-42AA-9B72-14C707639E3F\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/2604afd65043e8f9d4be036cb1242adf6b5723cf\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/f432a1621f049bb207e78363d9d0e3c6fa2da5db\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


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.