From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 DF1013A7593 for ; Sun, 19 Jul 2026 15:42:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784475753; cv=none; b=NmU5JHLIt450snJDYW3U8uOgS9jYtfaCsEYrnEOfHiYFX2CgOVxcHWrsOwsuJHlrd6lwHt1LaQHCXhHsiDEn8I4HRr1PifyemACOZKiTI2yXwOWxvQKXIcMWqamfSqf1cJTN88H5kl9KlSbcIchn74T3P7QSLHzaMFPmVyZvhTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784475753; c=relaxed/simple; bh=9XGWC+yt8rkdcZmCE/yFMILGSev8wIin9xA5ASckk50=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aIpZjFPI1G/zYYmfoUHjs9L5g7hkSKs7SnMvC9EXrZ18grqQBoAlsAQem8MrYhnZYBi8au8vkjnY/eftxM33TmsF/J6r93zaPhd6INTnMvwhSCRBzVyWJBv7dn33ITD5BuGeH+BeCtCMuIFSFl2FFN80p7fmrgorHPZoc5WZPKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NVsOburs; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NVsOburs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0923F1F000E9; Sun, 19 Jul 2026 15:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784475751; bh=CNJ9xaQNIdnpIz1/mlIJ9y6+lr0hkE14oFd34GZwa+c=; h=From:To:Cc:Subject:Date:Reply-To; b=NVsObursfeBqMLBqk2ii4OpbCioR7JUBPiFnFzQVpje1OBJFA5S2nPlloMKPu1Kp3 GJ8pz7nIey/eK+Kj+6uEa66mlmJjO/eaPNplovnyBUTAuZtahmn9vX5CPyPY6sAXvt 5fI1LgaEBDxgOnaKpmizwEWQSert0nqPm0RExrzE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-64071: nvme-pci: fix use-after-free in nvme_free_host_mem() Date: Sun, 19 Jul 2026 17:38:53 +0200 Message-ID: <2026071913-CVE-2026-64071-5a2d@gregkh> X-Mailer: git-send-email 2.55.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=3931; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=PhdiMbk2a+skTPtig+k/5getajbN80vd9Zv/7wm03CU=; b=owGbwMvMwCRo6H6F97bub03G02pJDFkx71MPN1jsiXu2PX/txZveVqHXLXhutvkGLmLUXXD7r lfTJuW3HTEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRnDqGGS/nfGPtPHnYYp3x 17RLmzdNZ45OZ5hf/zhU9UJN8p1j5367Xpkzv83p756zAA== 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: nvme-pci: fix use-after-free in nvme_free_host_mem() nvme_free_host_mem() frees dev->hmb_sgt via dma_free_noncontiguous() but never clears the pointer afterward. This leads to a use-after-free if nvme_free_host_mem() is called twice in the same error path. This can happen during nvme_probe() when nvme_setup_host_mem() succeeds in allocating the HMB (setting dev->hmb_sgt) but nvme_set_host_mem() fails with an I/O error: nvme_setup_host_mem() nvme_alloc_host_mem_single() -> sets dev->hmb_sgt nvme_set_host_mem() -> fails with -EIO nvme_free_host_mem() -> frees hmb_sgt, but does NOT NULL it return error nvme_probe() error path: nvme_free_host_mem() -> dev->hmb_sgt is stale, use-after-free The second call dereferences the freed sgt, causing a NULL pointer dereference in iommu_dma_free_noncontiguous() when it accesses sgt->sgl->dma_address (the backing memory has been freed and zeroed). This is reproducible on Thunderbolt-attached NVMe devices (e.g., OWC Envoy Express behind a Dell WD22TB4 dock) where the device intermittently returns I/O errors during HMB setup due to PCIe link instability. BUG: kernel NULL pointer dereference, address: 0000000000000010 RIP: 0010:iommu_dma_free_noncontiguous+0x22/0x80 Call Trace: dma_free_noncontiguous+0x3b/0x130 nvme_free_host_mem+0x30/0xf0 [nvme] nvme_probe.cold+0xcc/0x275 [nvme] local_pci_probe+0x43/0xa0 pci_device_probe+0xeea/0x290 really_probe+0xf9/0x3b0 __driver_probe_device+0x8b/0x170 driver_probe_device+0x24/0xd0 __driver_attach_async_helper+0x6b/0x110 async_run_entry_fn+0x37/0x170 process_one_work+0x1ac/0x3d0 worker_thread+0x1b8/0x360 kthread+0xf7/0x130 ret_from_fork+0x2d8/0x3a0 ret_from_fork_asm+0x1a/0x30 Fix this by setting dev->hmb_sgt to NULL after freeing it, so the second call takes the multi-descriptor path which safely handles the already-cleaned-up state. The Linux kernel CVE team has assigned CVE-2026-64071 to this issue. Affected and fixed versions =========================== Issue introduced in 6.13 with commit 63a5c7a4b4c49ad86c362e9f555e6f343804ee1d and fixed in 6.18.34 with commit 9525e3a6fbb1d126a22ab2ee86ddea25af581a7c Issue introduced in 6.13 with commit 63a5c7a4b4c49ad86c362e9f555e6f343804ee1d and fixed in 7.0.11 with commit 7c89f474005d8377525d2991930b7432ee193a52 Issue introduced in 6.13 with commit 63a5c7a4b4c49ad86c362e9f555e6f343804ee1d and fixed in 7.1 with commit b35a13036755c5803168a7cb93bc66035c3e65b8 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-2026-64071 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/nvme/host/pci.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/9525e3a6fbb1d126a22ab2ee86ddea25af581a7c https://git.kernel.org/stable/c/7c89f474005d8377525d2991930b7432ee193a52 https://git.kernel.org/stable/c/b35a13036755c5803168a7cb93bc66035c3e65b8