From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E65CC18DF80 for ; Mon, 8 Dec 2025 00:48:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765154884; cv=none; b=rY0WPJ5HMvOg95hYsS88Dx2VuENzh1NdWyIKD0h8tltMT895hIgQQUz8tH5TGKgnc0THFZiIUKi+rJcJT/9y/RhgyvqLfYzdPn01Cy+35fJgmNbsZOLT+F2NYrNnzvy965X+wvA515NbFQPo9uNoylwGC7Eavuv8nzMUTo5tcDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765154884; c=relaxed/simple; bh=jXwNtT9NE285QfxAaE63WqgH0BA65SO6uOIhQzvwoww=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ghZDYLbTJZs3JPLMYZ3SrElHEwHF8AeLxPorV5o3+ZI0SFGnwgfx1S08JzlHSDESO1EJ+SJZ2kUOG2PxAK6JtVGniyD//ZXRfS+wqz4SyGirbs0CTosVBlQxBC2UdPQgv+1LX2xKCUR3o73WZ+xoNaWfQoMyAL6FYnDSLIOApI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MB5/S9Zt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MB5/S9Zt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3905FC4CEFB; Mon, 8 Dec 2025 00:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765154883; bh=jXwNtT9NE285QfxAaE63WqgH0BA65SO6uOIhQzvwoww=; h=From:To:Cc:Subject:Date:Reply-To:From; b=MB5/S9Zt58cxXwiO5zXuPNTmej7E1DWNdH1zZdV9xm+Usfv+11GL6+xakn8qBPVn9 WzI8wHAIzgJ679INFVyg33ujThAePRvBqfKDOTwk7qxOcJ0yfdzLG/KIUZeD+9Vw7I 6L2kVaPMb83yntP9VEs6VOELSb97iUsMUgUziDR0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40311: accel/habanalabs: support mapping cb with vmalloc-backed coherent memory Date: Mon, 8 Dec 2025 09:47:35 +0900 Message-ID: <2025120821-CVE-2025-40311-34ea@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2431; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=PBV6Q58rUHoaAuUs8ecf4I39riAi/Lvem6WsHIlvwZ8=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlmCpKiRb8z1+5I2B/beH7tjuz0Z1O7OA6K2x5bdIjBp /F5/Y1nHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRV8sZ5oecC7m4XStj56IK vZm8ieL2goUXEhnmCmxOuLVm+fTDGyoL2g5NucyQ39qgAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman 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. The Linux kernel CVE team has assigned CVE-2025-40311 to this issue. Affected and fixed versions =========================== Fixed in 6.6.117 with commit 7ec8ac9f73d4a9438c2186768d6de27ace37531e Fixed in 6.12.58 with commit d1dfe21a332d38a6a09658ec29a55940afb5fe36 Fixed in 6.17.8 with commit 73c7c2cdb442fc4160d2a2a4bfffbd162af06cb9 Fixed in 6.18 with commit 513024d5a0e34fd34247043f1876b6138ca52847 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-40311 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/accel/habanalabs/gaudi/gaudi.c drivers/accel/habanalabs/gaudi2/gaudi2.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/7ec8ac9f73d4a9438c2186768d6de27ace37531e https://git.kernel.org/stable/c/d1dfe21a332d38a6a09658ec29a55940afb5fe36 https://git.kernel.org/stable/c/73c7c2cdb442fc4160d2a2a4bfffbd162af06cb9 https://git.kernel.org/stable/c/513024d5a0e34fd34247043f1876b6138ca52847