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 19B7B1990B5 for ; Tue, 16 Jul 2024 11:29:52 +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=1721129393; cv=none; b=oVdCOQPb8hxPsfWKJCOfTJO32k1ZJo/LsGUIZCxF/ejblH3iDvXy3ysviN8WntjKUYPNIBlCwSZpGs9Cd1vTn/M9mh4T9Ba9aAzzW2qYFrO6WDNBTygI2FDoGGxKEiJip9CpgUp3E0xj6khkGlnlKQVB1s4naMtzv7KZM+3tSUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721129393; c=relaxed/simple; bh=Yo5z3hEJTNmFOxZP+90o136+A1zQT0m7e4cUQvl0cEo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ir7atDUDjK2sGP7vkh2Cpn1LoFfznTE54Mp+Ltkj2XTc03PR3V282Nkmc4PewsZJXlDONK+Lii4/T0LLTu2jRMkcnMGoHJTNUXpf1imG/1qeVlPgkqPIHDPoMWDzGiY6dxRPAbeZZRF9En6uQQzDQ7qFSQah74XC627oD2JDHrQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pJF/3kSO; 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="pJF/3kSO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F2AFC116B1; Tue, 16 Jul 2024 11:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721129392; bh=Yo5z3hEJTNmFOxZP+90o136+A1zQT0m7e4cUQvl0cEo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=pJF/3kSO98j6CjgFXoK0lbdjLupLkL1X35X+l/b8F0kqidMCtoCsUFaUelGM47hac a+mlALwa7eoqo+qZBvGOtcxCmm2x8CRvrFx7EjOXI1L86XzniW3yq2B4awa4F4CKKG nqbgANhnLb1Mfa5HmZFdTiR5PZbltysgbPwuQxdo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47622: scsi: ufs: Fix a deadlock in the error handler Date: Tue, 16 Jul 2024 13:29:44 +0200 Message-ID: <2024071643-CVE-2021-47622-2e8d@gregkh> X-Mailer: git-send-email 2.45.2 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=2601; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Yo5z3hEJTNmFOxZP+90o136+A1zQT0m7e4cUQvl0cEo=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnTIpcfOGx2+EHWB7d3388blqUd2R/A/63g3KYH/t7/p 6SYOXGGdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEju1gmKcdxmd2ZK8pb3TT PKWFrxb0H2N6d4BhfqWlfuf8tmJrL97ZzqaPLrv3FeZOBwA= 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: scsi: ufs: Fix a deadlock in the error handler The following deadlock has been observed on a test setup: - All tags allocated - The SCSI error handler calls ufshcd_eh_host_reset_handler() - ufshcd_eh_host_reset_handler() queues work that calls ufshcd_err_handler() - ufshcd_err_handler() locks up as follows: Workqueue: ufs_eh_wq_0 ufshcd_err_handler.cfi_jt Call trace: __switch_to+0x298/0x5d8 __schedule+0x6cc/0xa94 schedule+0x12c/0x298 blk_mq_get_tag+0x210/0x480 __blk_mq_alloc_request+0x1c8/0x284 blk_get_request+0x74/0x134 ufshcd_exec_dev_cmd+0x68/0x640 ufshcd_verify_dev_init+0x68/0x35c ufshcd_probe_hba+0x12c/0x1cb8 ufshcd_host_reset_and_restore+0x88/0x254 ufshcd_reset_and_restore+0xd0/0x354 ufshcd_err_handler+0x408/0xc58 process_one_work+0x24c/0x66c worker_thread+0x3e8/0xa4c kthread+0x150/0x1b4 ret_from_fork+0x10/0x30 Fix this lockup by making ufshcd_exec_dev_cmd() allocate a reserved request. The Linux kernel CVE team has assigned CVE-2021-47622 to this issue. Affected and fixed versions =========================== Fixed in 5.15.25 with commit 493c9e850677 Fixed in 5.16.11 with commit d69d98d8edf9 Fixed in 5.17 with commit 945c3cca05d7 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-2021-47622 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/scsi/ufs/ufshcd.c drivers/scsi/ufs/ufshcd.h 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/493c9e850677df8b4eda150c2364b1c1a72ed724 https://git.kernel.org/stable/c/d69d98d8edf90e25e4e09930dd36dd6d09dd6768 https://git.kernel.org/stable/c/945c3cca05d78351bba29fa65d93834cb7934c7b