← Back to CVE Explorer

CVE-2025-40311

Full vulnerability record from the local CVENow database.

Description

In the Linux kernel, the following vulnerability has been resolved: accel/habanalabs: support mapping cb with vmalloc-backed coherent memory When IOMMU is enabled, dma_alloc_coherent() with GFP_USER may return addresses from the vmalloc range. If such an address is mapped without VM_MIXEDMAP, vm_insert_page() will trigger a BUG_ON due to the VM_PFNMAP restriction. Fix this by checking for vmalloc addresses and setting VM_MIXEDMAP in the VMA before mapping. This ensures safe mapping and avoids kernel crashes. The memory is still driver-allocated and cannot be accessed directly by userspace.

Severity
Not scored
CVSS score
Not available
Vulnerability status
Deferred
Source identifier
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Published
2025-12-08 01:16:03.477000
Last modified
2026-10-30 13:18:15.057000
View original CVE JSON
{
  "id": "CVE-2025-40311",
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "published": "2025-12-08T01:16:03.477",
  "lastModified": "2026-10-30T13:18:15.057",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\naccel/habanalabs: support mapping cb with vmalloc-backed coherent memory\n\nWhen IOMMU is enabled, dma_alloc_coherent() with GFP_USER may return\naddresses from the vmalloc range. If such an address is mapped without\nVM_MIXEDMAP, vm_insert_page() will trigger a BUG_ON due to the\nVM_PFNMAP restriction.\n\nFix this by checking for vmalloc addresses and setting VM_MIXEDMAP\nin the VMA before mapping. This ensures safe mapping and avoids kernel\ncrashes. The memory is still driver-allocated and cannot be accessed\ndirectly by userspace."
    },
    {
      "lang": "es",
      "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\naccel/habanalabs: soporte para mapear cb con memoria coherente respaldada por vmalloc\n\nCuando IOMMU está habilitado, dma_alloc_coherent() con GFP_USER puede devolver direcciones del rango de vmalloc. Si dicha dirección se mapea sin VM_MIXEDMAP, vm_insert_page() activará un BUG_ON debido a la restricción de VM_PFNMAP.\n\nSolucione esto verificando las direcciones de vmalloc y configurando VM_MIXEDMAP en el VMA antes del mapeo. Esto asegura un mapeo seguro y evita fallos del kernel. La memoria sigue siendo asignada por el controlador y no puede ser accedida directamente por el espacio de usuario."
    }
  ],
  "affected": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "affectedData": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "programFiles": [
            "drivers/accel/habanalabs/gaudi/gaudi.c",
            "drivers/accel/habanalabs/gaudi2/gaudi2.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "ac0ae6a96aa58eeba4aed97b12ef1dea8c5bf399",
              "lessThan": "8de421db5b1b2b37e9643ea7f6ade90fd756892d",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "ac0ae6a96aa58eeba4aed97b12ef1dea8c5bf399",
              "lessThan": "7ec8ac9f73d4a9438c2186768d6de27ace37531e",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "ac0ae6a96aa58eeba4aed97b12ef1dea8c5bf399",
              "lessThan": "d1dfe21a332d38a6a09658ec29a55940afb5fe36",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "ac0ae6a96aa58eeba4aed97b12ef1dea8c5bf399",
              "lessThan": "73c7c2cdb442fc4160d2a2a4bfffbd162af06cb9",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "ac0ae6a96aa58eeba4aed97b12ef1dea8c5bf399",
              "lessThan": "513024d5a0e34fd34247043f1876b6138ca52847",
              "versionType": "git",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "programFiles": [
            "drivers/accel/habanalabs/gaudi/gaudi.c",
            "drivers/accel/habanalabs/gaudi2/gaudi2.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "5.8",
              "status": "affected"
            },
            {
              "version": "0",
              "lessThan": "5.8",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.1.191",
              "lessThanOrEqual": "6.1.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.6.117",
              "lessThanOrEqual": "6.6.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.12.58",
              "lessThanOrEqual": "6.12.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.17.8",
              "lessThanOrEqual": "6.17.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.18",
              "lessThanOrEqual": "*",
              "versionType": "original_commit_for_fix",
              "status": "unaffected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {},
  "references": [
    {
      "url": "https://git.kernel.org/stable/c/513024d5a0e34fd34247043f1876b6138ca52847",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/73c7c2cdb442fc4160d2a2a4bfffbd162af06cb9",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/7ec8ac9f73d4a9438c2186768d6de27ace37531e",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/8de421db5b1b2b37e9643ea7f6ade90fd756892d",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/d1dfe21a332d38a6a09658ec29a55940afb5fe36",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ]
}