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 A32B821350 for ; Thu, 22 Aug 2024 03:34:19 +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=1724297659; cv=none; b=IwpcbO1bO5dbGndPLRY7TmkeAyal/AQe9SiH6lxEVhjhZpZsPnb47gu5A8+U/n99zcugQA7nYFlMmvn9LwOF4zplxLDTWVvlM1mdHriyEw/D43i3ZqvjulltN/kSes35T+4lO0gmoGD8TF7xlEwnR9X90HBX3d1bCNSVpICM4bM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724297659; c=relaxed/simple; bh=uuIkTUSY6uiuXthW0fCbst8ZMU3DigooJ4U84eUk7h0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mWE5ZDjjKzfGDU/w4tJLqQdEOoDbbveBHcNVB+akEFJH2VpN1SQjEh4yNCvZGH7QZrjnjfyWicAHfaRw8+aZLtBwAXxXSjBeKNspIhLXcH4S3ylndAGecbg1PMBvAkiL5do9EIu8T2FcM9PyMPlX/SPuv1/NxUdSxxvpXefg2IA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O9d7ouze; 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="O9d7ouze" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C107C4AF0B; Thu, 22 Aug 2024 03:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724297659; bh=uuIkTUSY6uiuXthW0fCbst8ZMU3DigooJ4U84eUk7h0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=O9d7ouze/oecReN2xFilI6CRdDhJ1B+V9sYDnQRnA9tdIUGOvQcYdmI2/I1wBn5OB x+yObeI9ex1d0JqrCfIqoBxutXGxXkkEDldxyZ77NCBVCgT3Pzb7iO+7qnuWUR/RlD jxzWwOrXAR9aIxD1tzFLRbc25wr+3F5o8I0ogK1M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48941: ice: fix concurrent reset and removal of VFs Date: Thu, 22 Aug 2024 11:31:42 +0800 Message-ID: <2024082226-CVE-2022-48941-32f7@gregkh> X-Mailer: git-send-email 2.46.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=3730; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=uuIkTUSY6uiuXthW0fCbst8ZMU3DigooJ4U84eUk7h0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnHNvKde6KWKGC/sWuS9Ln7QfUMuku7op9vfK6uIbQxN eJs6j2jjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIQwHDgpU6Dh2Fr+JTthsm fPI6FcjGzZTtxjC/2jaHL9rS+Mp+qZNcpbeevlk9YwYPAA== 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: ice: fix concurrent reset and removal of VFs Commit c503e63200c6 ("ice: Stop processing VF messages during teardown") introduced a driver state flag, ICE_VF_DEINIT_IN_PROGRESS, which is intended to prevent some issues with concurrently handling messages from VFs while tearing down the VFs. This change was motivated by crashes caused while tearing down and bringing up VFs in rapid succession. It turns out that the fix actually introduces issues with the VF driver caused because the PF no longer responds to any messages sent by the VF during its .remove routine. This results in the VF potentially removing its DMA memory before the PF has shut down the device queues. Additionally, the fix doesn't actually resolve concurrency issues within the ice driver. It is possible for a VF to initiate a reset just prior to the ice driver removing VFs. This can result in the remove task concurrently operating while the VF is being reset. This results in similar memory corruption and panics purportedly fixed by that commit. Fix this concurrency at its root by protecting both the reset and removal flows using the existing VF cfg_lock. This ensures that we cannot remove the VF while any outstanding critical tasks such as a virtchnl message or a reset are occurring. This locking change also fixes the root cause originally fixed by commit c503e63200c6 ("ice: Stop processing VF messages during teardown"), so we can simply revert it. Note that I kept these two changes together because simply reverting the original commit alone would leave the driver vulnerable to worse race conditions. The Linux kernel CVE team has assigned CVE-2022-48941 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit c503e63200c6 and fixed in 5.10.104 with commit 05ae1f0fe9c6 Issue introduced in 5.14 with commit c503e63200c6 and fixed in 5.15.26 with commit 3c805fce07c9 Issue introduced in 5.14 with commit c503e63200c6 and fixed in 5.16.12 with commit 2a3e61de89ba Issue introduced in 5.14 with commit c503e63200c6 and fixed in 5.17 with commit fadead80fe4c Issue introduced in 5.13.12 with commit 8a0814243362 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-2022-48941 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/net/ethernet/intel/ice/ice.h drivers/net/ethernet/intel/ice/ice_main.c drivers/net/ethernet/intel/ice/ice_virtchnl_pf.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/05ae1f0fe9c6c5ead08b306e665763a352d20716 https://git.kernel.org/stable/c/3c805fce07c9dbc47d8a9129c7c5458025951957 https://git.kernel.org/stable/c/2a3e61de89bab6696aa28b70030eb119968c5586 https://git.kernel.org/stable/c/fadead80fe4c033b5e514fcbadd20b55c4494112