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 2ABC52F85B for ; Tue, 9 Dec 2025 01:31:21 +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=1765243882; cv=none; b=Bp7er9zsfW1HtO6TCdV7ANpzwfuA8UChBK123F2ObrQeLVX0/oQDFKQj+fQ8GxX7jxKxg1SecqwSb+JCkOZDm058bycz8klh4T+eNFGv2hyAObms7u9vmxNFdTxs4L0Uo3O6m174RUIr3NrQ0Ci4iNPd++dNySzvXtN7j2yLYIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765243882; c=relaxed/simple; bh=aDxEM6Hvmcx4C+iVWuMPEoIPIRWC1zkUU8SekBcy+Bw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d7oUZQ+6Y37Q88Ao7aDDLwsO3jSAlxUKKZqygl1mSZymXGhEjQiq/fWZMEpK9Q4+dbROQeV25jihgESWi53cc5fFsmRoJnXWLGgRJekYSOKtHMxM+8GUW4/bAgEL7wcbozQIeoKiPB9NffUfDAs8jqXRlxg5qGfHxk5J5zTnbEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=P2w4WP8x; 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="P2w4WP8x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F47EC19421; Tue, 9 Dec 2025 01:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765243881; bh=aDxEM6Hvmcx4C+iVWuMPEoIPIRWC1zkUU8SekBcy+Bw=; h=From:To:Cc:Subject:Date:Reply-To:From; b=P2w4WP8xX5hsr4twVAZ2/JrJfXZdPKe/xWDEms03GzjcWcizqqdThCyTy996FBYaV C7UgP9s7lvAy7iYVXEcx/dXkOfozUassZywqWUpZPXZaSZovu0MSQbjLh1etxOBPZt kYrQ89Ll1PG/nLY7ynmRNdHdr7A7hDtopwUJ8Kko= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50668: ext4: fix deadlock due to mbcache entry corruption Date: Tue, 9 Dec 2025 10:30:53 +0900 Message-ID: <2025120945-CVE-2022-50668-153a@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3874; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=YuitWpJ14+4+/swdZbpiK6j/VK6odMm2a8yxWZZbjUk=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnm1Ud9W67YT3UtnaTjdf+TiPTdRV9nW6xqr1ZX55WLL P3+RHpmRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkcDXDgh0eEU97NXvfbKqb PNFri6Ln4mnHwxnmV5fHBzcwWx5I0rTrbXA+8C9gSzQjAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: ext4: fix deadlock due to mbcache entry corruption When manipulating xattr blocks, we can deadlock infinitely looping inside ext4_xattr_block_set() where we constantly keep finding xattr block for reuse in mbcache but we are unable to reuse it because its reference count is too big. This happens because cache entry for the xattr block is marked as reusable (e_reusable set) although its reference count is too big. When this inconsistency happens, this inconsistent state is kept indefinitely and so ext4_xattr_block_set() keeps retrying indefinitely. The inconsistent state is caused by non-atomic update of e_reusable bit. e_reusable is part of a bitfield and e_reusable update can race with update of e_referenced bit in the same bitfield resulting in loss of one of the updates. Fix the problem by using atomic bitops instead. This bug has been around for many years, but it became *much* easier to hit after commit 65f8b80053a1 ("ext4: fix race when reusing xattr blocks"). The Linux kernel CVE team has assigned CVE-2022-50668 to this issue. Affected and fixed versions =========================== Issue introduced in 4.6 with commit 6048c64b26097a0ffbd966866b599f990e674e9b and fixed in 4.19.270 with commit efaa0ca678f56d47316a08030b2515678cebbc50 Issue introduced in 4.6 with commit 6048c64b26097a0ffbd966866b599f990e674e9b and fixed in 5.4.229 with commit af53065276376750dfac35a7248af18806404c5d Issue introduced in 4.6 with commit 6048c64b26097a0ffbd966866b599f990e674e9b and fixed in 5.10.163 with commit 1be16a0c2f10186df505e28b0cc92d7f3366e2a8 Issue introduced in 4.6 with commit 6048c64b26097a0ffbd966866b599f990e674e9b and fixed in 5.15.87 with commit 5bc0b2fda4b47c86278f7c6d30c211f425bf51cf Issue introduced in 4.6 with commit 6048c64b26097a0ffbd966866b599f990e674e9b and fixed in 6.0.18 with commit 127b80cefb941a81255c72f11081123f3a705369 Issue introduced in 4.6 with commit 6048c64b26097a0ffbd966866b599f990e674e9b and fixed in 6.1.4 with commit cc1538c693d25e282bed8c54b65c914a04023a78 Issue introduced in 4.6 with commit 6048c64b26097a0ffbd966866b599f990e674e9b and fixed in 6.2 with commit a44e84a9b7764c72896f7241a0ec9ac7e7ef38dd 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-50668 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/ext4/xattr.c fs/mbcache.c include/linux/mbcache.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/efaa0ca678f56d47316a08030b2515678cebbc50 https://git.kernel.org/stable/c/af53065276376750dfac35a7248af18806404c5d https://git.kernel.org/stable/c/1be16a0c2f10186df505e28b0cc92d7f3366e2a8 https://git.kernel.org/stable/c/5bc0b2fda4b47c86278f7c6d30c211f425bf51cf https://git.kernel.org/stable/c/127b80cefb941a81255c72f11081123f3a705369 https://git.kernel.org/stable/c/cc1538c693d25e282bed8c54b65c914a04023a78 https://git.kernel.org/stable/c/a44e84a9b7764c72896f7241a0ec9ac7e7ef38dd