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 80281302CAC for ; Fri, 4 Jul 2025 13:43:20 +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=1751636600; cv=none; b=LtDMufogwB4axjq1rXNKhPr7BSkzwNuwbhtj5SI8Sv8vykQCViZ8W75BjY2/FTJsWHG0h3TcXzJ84AV9HcZs8hSkupoT8+adXKFXCWmpkV6Wd2ozfE+0orTHCWjVVMTfspswhkxp1npqhHp2MTwIpACkxXy6wYX3sjLrzP0+3UA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751636600; c=relaxed/simple; bh=JLhN0pOE6xPUVKoA/0rpM3WJ54h3xeQJwXCPSf/7D0w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Oz7JZaI3PpJ8GCYarjpuIYGjXtsvtmcENGM+4DqWWE0hhkpU2JufXG9mvoDil3EFanweJ2TduJtcmjIZm9xKg6K84k4nCPe0y58siCEe/nHmSsvQNpykWGi2241VzPVzWPorTFQ+Gl9pVtRNN08ue4MsVQXLcIvXY0SJ4UFAyis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HGiy/8ka; 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="HGiy/8ka" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC257C4CEEB; Fri, 4 Jul 2025 13:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751636600; bh=JLhN0pOE6xPUVKoA/0rpM3WJ54h3xeQJwXCPSf/7D0w=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HGiy/8kak2kgJuDxLfeNXDkkhElGtcGozrVeZr9vDbuhp7PvzF16+3XCF7tG0GWYu 6EN6js4kNIO7rE3d5ShxlByPdTOwy9mIk/t+t2JsIXmsZajaRA99HUyO6KlETqlhHd 8aH9q4+E8EOAZPHum3Q8nNxGWfziJ8HASnR21jYg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38209: nvme-tcp: remove tag set when second admin queue config fails Date: Fri, 4 Jul 2025 15:37:38 +0200 Message-ID: <2025070421-CVE-2025-38209-52b8@gregkh> X-Mailer: git-send-email 2.50.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3813; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=YCBDr9v+LqGcsy/2fFkaey3DYiLmoMinq3JHOQzS+XU=; b=kA0DAAIRMUfUDdst+ykByyZiAGhn2RGj482mClPnSH7xQElJFw/hnJhMXygFNQE2VHyMxXDXW IhdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmhn2REACgkQMUfUDdst+ynajwCfRUw2 9cva9j6ri3Ys1qEDxyhVqNgAnjm9xkhn/MGDSIZwgoMsXokKc69A 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-tcp: remove tag set when second admin queue config fails Commit 104d0e2f6222 ("nvme-fabrics: reset admin connection for secure concatenation") modified nvme_tcp_setup_ctrl() to call nvme_tcp_configure_admin_queue() twice. The first call prepares for DH-CHAP negotitation, and the second call is required for secure concatenation. However, this change triggered BUG KASAN slab-use-after- free in blk_mq_queue_tag_busy_iter(). This BUG can be recreated by repeating the blktests test case nvme/063 a few times [1]. When the BUG happens, nvme_tcp_create_ctrl() fails in the call chain below: nvme_tcp_create_ctrl() nvme_tcp_alloc_ctrl() new=true ... Alloc nvme_tcp_ctrl and admin_tag_set nvme_tcp_setup_ctrl() new=true nvme_tcp_configure_admin_queue() new=true ... Succeed nvme_alloc_admin_tag_set() ... Alloc the tag set for admin_tag_set nvme_stop_keep_alive() nvme_tcp_teardown_admin_queue() remove=false nvme_tcp_configure_admin_queue() new=false nvme_tcp_alloc_admin_queue() ... Fail, but do not call nvme_remove_admin_tag_set() nvme_uninit_ctrl() nvme_put_ctrl() ... Free up the nvme_tcp_ctrl and admin_tag_set The first call of nvme_tcp_configure_admin_queue() succeeds with new=true argument. The second call fails with new=false argument. This second call does not call nvme_remove_admin_tag_set() on failure, due to the new=false argument. Then the admin tag set is not removed. However, nvme_tcp_create_ctrl() assumes that nvme_tcp_setup_ctrl() would call nvme_remove_admin_tag_set(). Then it frees up struct nvme_tcp_ctrl which has admin_tag_set field. Later on, the timeout handler accesses the admin_tag_set field and causes the BUG KASAN slab-use-after-free. To not leave the admin tag set, call nvme_remove_admin_tag_set() when the second nvme_tcp_configure_admin_queue() call fails. Do not return from nvme_tcp_setup_ctrl() on failure. Instead, jump to "destroy_admin" go-to label to call nvme_tcp_teardown_admin_queue() which calls nvme_remove_admin_tag_set(). The Linux kernel CVE team has assigned CVE-2025-38209 to this issue. Affected and fixed versions =========================== Issue introduced in 6.15 with commit 104d0e2f622233477ef7e57e59e8a4c3bb062c82 and fixed in 6.15.4 with commit db1da838b6012e4570c6f81e28ffe1d0ff595948 Issue introduced in 6.15 with commit 104d0e2f622233477ef7e57e59e8a4c3bb062c82 and fixed in 6.16-rc1 with commit e7143706702a209c814ed2c3fc6486c2a7decf6c 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-38209 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/tcp.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/db1da838b6012e4570c6f81e28ffe1d0ff595948 https://git.kernel.org/stable/c/e7143706702a209c814ed2c3fc6486c2a7decf6c