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 D5E9613A890 for ; Wed, 17 Apr 2024 10:10:23 +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=1713348623; cv=none; b=gJoF0Y+dRcT+cmOByKSP4dM4VyRrnBbTcEg6xjITXPrBNTv0BD/LG8KoKdi/ZD1sOlmx2Fy4tWj7rmKO3yo6lcKTn6YChRM0G9yamWdePhMCfOTUD2g7wc7KVmZjlcnL1SOJ61wMRTtw8lDuiNgSZTAvn/Z415p+KKKncEC51Pc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713348623; c=relaxed/simple; bh=4UeVMUR6tlT2YikM5qUgtYjtlLHyjQlk1fK7DSY9Qc4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cyWokVOavxOyLqN9WQpyj3ocgCfabs4GJiGpZ66BYR3kGRFGNTHnkzOLwTJ/aZmcrfRM3A3McSVRPx3YjpheTJy/76XYxqSvVd4JP3N01xU+41muFabbQg3HTlCZi+vvdQetdDfrLLyt54wDZApLSiNQyTtBcu0tJCA7jOcW+C8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HLbswsiS; 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="HLbswsiS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D35EC2BD10; Wed, 17 Apr 2024 10:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713348623; bh=4UeVMUR6tlT2YikM5qUgtYjtlLHyjQlk1fK7DSY9Qc4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HLbswsiSH+4vS7K+TWjuQi1H24CadjvQSkUAB98kTN44z31Uxu3emnxz7VX4cN5ri hRveFSGifQdVoEm6FEjDvQ8MziglhEbEQxKwKB+p/MMJ9js2vXoj0OM6n0X6XJWote HhviGxb3i7GMOloQhCwjJ3163O058dte9GkeujyE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26832: mm: zswap: fix missing folio cleanup in writeback race path Date: Wed, 17 Apr 2024 12:10:14 +0200 Message-ID: <2024041714-CVE-2024-26832-77ce@gregkh> X-Mailer: git-send-email 2.44.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=2704; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4UeVMUR6tlT2YikM5qUgtYjtlLHyjQlk1fK7DSY9Qc4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnyC9jWPOqV1tzA4d5s8d1lV+DjRe6zbfXDD710P/NSI /9iGC9/RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkyHWG+XkGP5hlyv05tt27 +pBRsox3D89Kb4b5Tnw53dbGM2fvvbVGSozjz4tZMoWTAA== 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: mm: zswap: fix missing folio cleanup in writeback race path In zswap_writeback_entry(), after we get a folio from __read_swap_cache_async(), we grab the tree lock again to check that the swap entry was not invalidated and recycled. If it was, we delete the folio we just added to the swap cache and exit. However, __read_swap_cache_async() returns the folio locked when it is newly allocated, which is always true for this path, and the folio is ref'd. Make sure to unlock and put the folio before returning. This was discovered by code inspection, probably because this path handles a race condition that should not happen often, and the bug would not crash the system, it will only strand the folio indefinitely. The Linux kernel CVE team has assigned CVE-2024-26832 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1.30 with commit 2cab13f500a6 and fixed in 6.1.80 with commit 14f1992430ef Issue introduced in 6.4 with commit 04fc7816089c and fixed in 6.6.19 with commit 6156277d1b26 Issue introduced in 6.4 with commit 04fc7816089c and fixed in 6.7.7 with commit e2891c763aa2 Issue introduced in 6.4 with commit 04fc7816089c and fixed in 6.8 with commit e3b63e966cac Issue introduced in 6.3.4 with commit ba700ea13bf0 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-26832 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: mm/zswap.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/14f1992430ef9e647b02aa8ca12c5bcb9a1dffea https://git.kernel.org/stable/c/6156277d1b26cb3fdb6fcbf0686ab78268571644 https://git.kernel.org/stable/c/e2891c763aa2cff74dd6b5e978411ccf0cf94abe https://git.kernel.org/stable/c/e3b63e966cac0bf78aaa1efede1827a252815a1d