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 73E541D554 for ; Tue, 21 Jan 2025 12:19:05 +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=1737461945; cv=none; b=WodZ4AeH2OkTVav0JMBu/nNejOEo1+7NtxoDJNCjysLMjWIhaH83hvJoGYL4C82v/CuPh+xiXL1LJG0xU7Ybd6HIJaaHzz0krAEe8JDtY0hU/UqBZgw0woqPHH2Hq58fG+u8LMaUCqXA6XRFz9AqLxC7b7kXIIjEtkLLO+yI2zY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737461945; c=relaxed/simple; bh=VMgLry2JbBUTm6whCBllQBjrmyc0DTvUKnXgr6IWuBA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=K57oMFEB50TyzT6UPm/q52hlX5+NvpUI2g0I1+mOfGAfkYfW9QAXO7PVHjSePO1Eu5GhsQrJB2X0tLrB9oxNkiGcYoMlsL2eoYHyPd6RQRhPzpgiEjlJJ4P3953w/v+Az3j2Op79fYfMLAO6LptF/93ZpBkRzVJuS5XmlZetGvA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WdzXBaEt; 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="WdzXBaEt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F17CDC4CEDF; Tue, 21 Jan 2025 12:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1737461945; bh=VMgLry2JbBUTm6whCBllQBjrmyc0DTvUKnXgr6IWuBA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=WdzXBaEtv3bUJjRmXffQeqI3ajF/SLNLXSt0yglkFOdaDtygBcanZ9kMqp5zqHhFO cEZ/ToZ4TW5DEM0bsS9uz1V05ZwFM9rsUUdD8s1cYq1uID1MOfEUQIAzsOQ9WqlNZo /cZvr4IIfC/SYBbKeJHHnAZLBTFKLxhFmjh56C/I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-57941: netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled Date: Tue, 21 Jan 2025 13:18:30 +0100 Message-ID: <2025012128-CVE-2024-57941-8779@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=2832; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=VMgLry2JbBUTm6whCBllQBjrmyc0DTvUKnXgr6IWuBA=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn9E6ZcPXKsUfLula6nEVcZbOUXz/2wkW3agkaRRKeb0 f+Zr1bwdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEZpkzLOgWa7Lokpt8Wzh5 Y/Hr+DmKk4ysdzDMYjIpndP145P/NLFVnXePCbc+/XBrCgA= 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: netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled When the caching for a cookie is temporarily disabled (e.g. due to a DIO write on that file), future copying to the cache for that file is disabled until all fds open on that file are closed. However, if netfslib is using the deprecated PG_private_2 method (such as is currently used by ceph), and decides it wants to copy to the cache, netfs_advance_write() will just bail at the first check seeing that the cache stream is unavailable, and indicate that it dealt with all the content. This means that we have no subrequests to provide notifications to drive the state machine or even to pin the request and the request just gets discarded, leaving the folios with PG_private_2 set. Fix this by jumping directly to cancel the request if the cache is not available. That way, we don't remove mark3 from the folio_queue list and netfs_pgpriv2_cancel() will clean up the folios. This was found by running the generic/013 xfstest against ceph with an active cache and the "-o fsc" option passed to ceph. That would usually hang The Linux kernel CVE team has assigned CVE-2024-57941 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit ee4cdf7ba857a894ad1650d6ab77669cbbfa329e and fixed in 6.12.10 with commit ba37bdfe59fb43e80dd79290340a21864ba4b61e Issue introduced in 6.12 with commit ee4cdf7ba857a894ad1650d6ab77669cbbfa329e and fixed in 6.13 with commit d0327c824338cdccad058723a31d038ecd553409 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-57941 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/netfs/read_pgpriv2.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/ba37bdfe59fb43e80dd79290340a21864ba4b61e https://git.kernel.org/stable/c/d0327c824338cdccad058723a31d038ecd553409