From mboxrd@z Thu Jan 1 00:00:00 1970 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 2F3FA21ADC3 for ; Wed, 26 Feb 2025 02:24:51 +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=1740536691; cv=none; b=pCglXasinNTEBt+JvsBq0KE2+2C6v/98Ry/GbE9rrMWPvikINhH0lzg4jLpKwQNiESKpbyTo6KPW51TFM8J/TumKbHPO3imC61IbBMFtbHb9KtsipbEu6p51FrohI/yxkaUSSdnsa0KykxuNctUl/ptnfW6JTuV1aZuUjofOKX0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536691; c=relaxed/simple; bh=rV5PMTu7C8nPkhxM7ycJ1aGPW74J+6yhtF/E6e/WZVM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lQfGx157iohXfGv3Dao41KRXi4w9E0/R4i/7cAnQmxAGi2KBJEGvySwrEdj8vNgdkGz1xT+S1PZOOg4bHczXqlqMDrCXag4B3NY52/0nbLoIvSaJ97X+R1yBeEc+lcXUVbI5qXQsInw+Uqu+1yCHdTaG2bzPFxWeYvpGCnKWzBc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eDmOgUHv; 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="eDmOgUHv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3915C4CEDD; Wed, 26 Feb 2025 02:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536691; bh=rV5PMTu7C8nPkhxM7ycJ1aGPW74J+6yhtF/E6e/WZVM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=eDmOgUHvYR+r3BL+QArSn4s4uKqn/fAzM/wY05iSSiDDoNYvFAWDnQf6HDGbWRLac gI9XeS3UVfiJK0UjH5Ag9NvL/h6X3j03dRQ7QJa5O5HO7jFMAgx1YKyOy3dinxlvV2 h8u9W2Nn4cZV5iWWRuUWCJMWIx/9s+nshrUBhqVY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49655: fscache: Fix invalidation/lookup race Date: Wed, 26 Feb 2025 03:23:38 +0100 Message-ID: <2025022621-CVE-2022-49655-0370@gregkh> X-Mailer: git-send-email 2.48.1 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=2571; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=rV5PMTu7C8nPkhxM7ycJ1aGPW74J+6yhtF/E6e/WZVM=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7qu46Hns3S9bPe6rNmkNO5n3qjNsKfQvuTAqw+FZTt 8Xg1w37jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIyx+GBZNW1pa/vC+2/Khr pfCKpNPdAp6GhgwLJn/m7D/aVjJBw/RKSIph1rvPGx+pAgA= 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: fscache: Fix invalidation/lookup race If an NFS file is opened for writing and closed, fscache_invalidate() will be asked to invalidate the file - however, if the cookie is in the LOOKING_UP state (or the CREATING state), then request to invalidate doesn't get recorded for fscache_cookie_state_machine() to do something with. Fix this by making __fscache_invalidate() set a flag if it sees the cookie is in the LOOKING_UP state to indicate that we need to go to invalidation. Note that this requires a count on the n_accesses counter for the state machine, which that will release when it's done. fscache_cookie_state_machine() then shifts to the INVALIDATING state if it sees the flag. Without this, an nfs file can get corrupted if it gets modified locally and then read locally as the cache contents may not get updated. The Linux kernel CVE team has assigned CVE-2022-49655 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit d24af13e2e2358a602740c7817ea90da43d3e740 and fixed in 5.18.11 with commit b1ae9f617f8a5c848d9205b8e228c6f0d1af754b Issue introduced in 5.17 with commit d24af13e2e2358a602740c7817ea90da43d3e740 and fixed in 5.19 with commit 85e4ea1049c70fb99de5c6057e835d151fb647da 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-49655 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: fs/fscache/cookie.c include/linux/fscache.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/b1ae9f617f8a5c848d9205b8e228c6f0d1af754b https://git.kernel.org/stable/c/85e4ea1049c70fb99de5c6057e835d151fb647da