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 6651B218EB7 for ; Thu, 8 May 2025 06:41:14 +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=1746686474; cv=none; b=lhu/yBeyCiMwCqms5dKaTVP6AZABOGPs7AJ7+vkX/ZgS5dTV1dL4ZABKZ80DjmbIswx/NqFm2nJinfABmj9p4nQ8SSyzbqrNmcDiHvCT0E1aTq/cJXeGdEDCjYPmU/STUg11snXxXVu6xPIZCca3Pxt8doAMpXXN+6tcGeZ2zSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746686474; c=relaxed/simple; bh=HxmOuHZWmTOIjxxIZAQqv7IkYDu0NCUIQfh3iIVyXIE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WArhqo42CdVTpI1urr6EHf7M6pXLAWqym43FFktP1EQ2JNNcVXSh6bIH4DE4xU/aFgCz+A/FuPReSZ8ZSQRVA9CYZllLU8DFfliEJjgH3XIuPcKZ3AaKmd8NflqCCjTXMiWKBPjI3kaZn/4k+qkWsF1YpICCyTby00mdh1T8OYI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vDPbk74g; 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="vDPbk74g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFA38C4CEEB; Thu, 8 May 2025 06:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746686474; bh=HxmOuHZWmTOIjxxIZAQqv7IkYDu0NCUIQfh3iIVyXIE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vDPbk74g5XVTy5KcCukM1oq4ujqhEsEciN7BFRw3ecVyOxbMLndP02twlhPMmk7VO oTI7bR1AxqTOq+x1uQuVzFBJeO4YzuahLsjSrZOlboqu2+iomxJX838Xw/vj9KlFol nbP13mljTxoWgOx3ze6N5NrDiUx9tAQFJfuJXGCM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37828: scsi: ufs: mcq: Add NULL check in ufshcd_mcq_abort() Date: Thu, 8 May 2025 08:39:37 +0200 Message-ID: <2025050823-CVE-2025-37828-b412@gregkh> X-Mailer: git-send-email 2.49.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=2914; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=zJfP5sEM7maTdcNsexFez3yHhGZ9iFehPQNFuk56pEg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkygbNXcS3oP+Zb+nDv8uDoPOcId0Gdl1wPdV9tjXdrs lvDxRfWEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABP5sIxhNht7j+dZ5WeLN6ce fPdVycy3PeqRKMOCxQr/o7oKUmotIv70s6T1H3Z5MksEAA== 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: scsi: ufs: mcq: Add NULL check in ufshcd_mcq_abort() A race can occur between the MCQ completion path and the abort handler: once a request completes, __blk_mq_free_request() sets rq->mq_hctx to NULL, meaning the subsequent ufshcd_mcq_req_to_hwq() call in ufshcd_mcq_abort() can return a NULL pointer. If this NULL pointer is dereferenced, the kernel will crash. Add a NULL check for the returned hwq pointer. If hwq is NULL, log an error and return FAILED, preventing a potential NULL-pointer dereference. As suggested by Bart, the ufshcd_cmd_inflight() check is removed. This is similar to the fix in commit 74736103fb41 ("scsi: ufs: core: Fix ufshcd_abort_one racing issue"). This is found by our static analysis tool KNighter. The Linux kernel CVE team has assigned CVE-2025-37828 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit f1304d4420777f82a1d844c606db3d9eca841765 and fixed in 6.6.89 with commit d6979fabe812a168d5053e5a41d5a2e9b8afd7bf Issue introduced in 6.5 with commit f1304d4420777f82a1d844c606db3d9eca841765 and fixed in 6.12.26 with commit 7d002f591486f5ef4bc02eb02025a53f931f0eb5 Issue introduced in 6.5 with commit f1304d4420777f82a1d844c606db3d9eca841765 and fixed in 6.14.5 with commit 47eec518aef3814f64a5da43df81bdd74d8c0041 Issue introduced in 6.5 with commit f1304d4420777f82a1d844c606db3d9eca841765 and fixed in 6.15-rc4 with commit 4c324085062919d4e21c69e5e78456dcec0052fe 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-37828 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/ufs/core/ufs-mcq.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/d6979fabe812a168d5053e5a41d5a2e9b8afd7bf https://git.kernel.org/stable/c/7d002f591486f5ef4bc02eb02025a53f931f0eb5 https://git.kernel.org/stable/c/47eec518aef3814f64a5da43df81bdd74d8c0041 https://git.kernel.org/stable/c/4c324085062919d4e21c69e5e78456dcec0052fe