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 65C831DD88D for ; Tue, 5 Nov 2024 17:13:00 +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=1730826780; cv=none; b=pbymIFoJGAbja8o/bTW3AqOU9qRkWHOOvbg7JRUWatjERUAp6gLtTNqlIYcPRKmlfYPHRY5kOaER9jK2zNHL4xw7MqaetnJN22NqwHcSrg2H6onavN9PlifHdt8dTqLSLIhyewSR7K/se9SGJMAF4tQgcKILEc/R5VomlLWucXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730826780; c=relaxed/simple; bh=gPCzVNuoilLGtOXo1FGEQ26x8sLLCyRs3lsr9uBulZw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=T6OHmmur7lcMF3SXn6MEFBBN//prIuJDwytkHIvOMZvYeDubxuV76x+ZL6RZru0ZoHsrSDrO+FuUSBDCUy0TKACHhAJ2JElKkx4M368L9r+knBqNJJdIUWWy/ZNqvHMsiLFBDB9TczLTerm9tLvM7FuZJPCKFO8Irrmu8PXOxB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=W89ygXCB; 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="W89ygXCB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2136C4CECF; Tue, 5 Nov 2024 17:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730826780; bh=gPCzVNuoilLGtOXo1FGEQ26x8sLLCyRs3lsr9uBulZw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=W89ygXCBos+GPWaHizdFgAqrIVi7cJCLhDKb5I48Hc7kHoTthHrPxPdpDHLA3YXFs NEchiRh1jn6xzvPLgL2A+w6D8bP79NAS6QD14WwHlZIVehSs9jQZc42IFxDmOCyjoF xeHwPlA7wRp2kxOojQIKtEd9qFBGmGSAzfOECIng= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50135: nvme-pci: fix race condition between reset and nvme_dev_disable() Date: Tue, 5 Nov 2024 18:11:24 +0100 Message-ID: <2024110559-CVE-2024-50135-d177@gregkh> X-Mailer: git-send-email 2.47.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=2662; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=gPCzVNuoilLGtOXo1FGEQ26x8sLLCyRs3lsr9uBulZw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlagYtVQnNav7IrpZ4+4cg+6xfn5N6F1s8UpvL4Ft294 K+ayCbREcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABM5yMAwv1jwQKLzbfkWg+V+ p/NzXr22uTvLnGFBl9/H2wp9S3q+/5RM+5MwLevk7SUbAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: nvme-pci: fix race condition between reset and nvme_dev_disable() nvme_dev_disable() modifies the dev->online_queues field, therefore nvme_pci_update_nr_queues() should avoid racing against it, otherwise we could end up passing invalid values to blk_mq_update_nr_hw_queues(). WARNING: CPU: 39 PID: 61303 at drivers/pci/msi/api.c:347 pci_irq_get_affinity+0x187/0x210 Workqueue: nvme-reset-wq nvme_reset_work [nvme] RIP: 0010:pci_irq_get_affinity+0x187/0x210 Call Trace: ? blk_mq_pci_map_queues+0x87/0x3c0 ? pci_irq_get_affinity+0x187/0x210 blk_mq_pci_map_queues+0x87/0x3c0 nvme_pci_map_queues+0x189/0x460 [nvme] blk_mq_update_nr_hw_queues+0x2a/0x40 nvme_reset_work+0x1be/0x2a0 [nvme] Fix the bug by locking the shutdown_lock mutex before using dev->online_queues. Give up if nvme_dev_disable() is running or if it has been executed already. The Linux kernel CVE team has assigned CVE-2024-50135 to this issue. Affected and fixed versions =========================== Issue introduced in 4.6 with commit 949928c1c731 and fixed in 6.6.59 with commit 4ed32cc0939b Issue introduced in 4.6 with commit 949928c1c731 and fixed in 6.11.6 with commit b33e49a5f254 Issue introduced in 4.6 with commit 949928c1c731 and fixed in 6.12-rc4 with commit 26bc0a81f64c 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-2024-50135 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/4ed32cc0939b64e3d7b48c8c0d63ea038775f304 https://git.kernel.org/stable/c/b33e49a5f254474b33ce98fd45dd0ffdc247a0be https://git.kernel.org/stable/c/26bc0a81f64ce00fc4342c38eeb2eddaad084dd2