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 D40A32153E8 for ; Wed, 26 Feb 2025 02:13:14 +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=1740535994; cv=none; b=M6YBlpGglzvRMMXoj8cqO1Qfye7xQXjIEkL0pGUhCs9i9YXRxLoKBYPTKK6MLOMJgYtz8isZDx3EfxKvm+RVqDurmSnLpFNKvWJ7uxBIL4gKWJ5b+h0BwNesDejXohLsL5tCwUrszmU2qhFL9ucip+aYLq5ZTIUsp66hH9HuHhI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535994; c=relaxed/simple; bh=E6nwQp6xNQNq0iVZCA0wYlWUgxDmRER2iukqtUWknRQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Dqx82co9gmewf9oMZ8rtxWipmvRtvJFRFHzxSjrzLGcP2nX0KRpuaTyltZ2XpAZ3+2p4qjoqqJVBomSD/MeFUwlJSlKauzoJJ8sI/0h4/E4tmPzXmCgPiOCT6j3YS9tWUZ1AdVM/V5UZ/icTp5whocsKG2qAaJOqxbXgA8cC3io= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CmjIX9a6; 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="CmjIX9a6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7026C4CEDD; Wed, 26 Feb 2025 02:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535994; bh=E6nwQp6xNQNq0iVZCA0wYlWUgxDmRER2iukqtUWknRQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CmjIX9a6ekysohgGct/pRBOyo7Y7k3ALwzfClDM/yY6XSJwQ9j0zzEHPO7bEB+D+Y /kZ+6I+VU3owA91/xJ25j++oH0IPngzqSupGAePjRrjzDI0o2nNrWeb2563lw17fKw E3KRXmUi3I/JVWQWAkY27bh56evo9j4AnQOrVCzE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49348: ext4: filter out EXT4_FC_REPLAY from on-disk superblock field s_state Date: Wed, 26 Feb 2025 03:10:22 +0100 Message-ID: <2025022642-CVE-2022-49348-d5db@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=2934; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=E6nwQp6xNQNq0iVZCA0wYlWUgxDmRER2iukqtUWknRQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7yp/9OWGX2FJjb5C114ll1ZfkdpZjP0z3VGxp+SJ4l m+W8Ef2jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAbhIKMP82h+r6hbqztzU73tv buwEbzv7wwVnGBacP7Ig7au9fNTdlm15Fz9rtdzcf5sdAA== 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: ext4: filter out EXT4_FC_REPLAY from on-disk superblock field s_state The EXT4_FC_REPLAY bit in sbi->s_mount_state is used to indicate that we are in the middle of replay the fast commit journal. This was actually a mistake, since the sbi->s_mount_info is initialized from es->s_state. Arguably s_mount_state is misleadingly named, but the name is historical --- s_mount_state and s_state dates back to ext2. What should have been used is the ext4_{set,clear,test}_mount_flag() inline functions, which sets EXT4_MF_* bits in sbi->s_mount_flags. The problem with using EXT4_FC_REPLAY is that a maliciously corrupted superblock could result in EXT4_FC_REPLAY getting set in s_mount_state. This bypasses some sanity checks, and this can trigger a BUG() in ext4_es_cache_extent(). As a easy-to-backport-fix, filter out the EXT4_FC_REPLAY bit for now. We should eventually transition away from EXT4_FC_REPLAY to something like EXT4_MF_REPLAY. The Linux kernel CVE team has assigned CVE-2022-49348 to this issue. Affected and fixed versions =========================== Fixed in 5.10.121 with commit cc5b09cb6dacd4b32640537929ab4ee8fb2b9e04 Fixed in 5.15.46 with commit b99fd73418350dea360da8311e87a6a7b0e15a4c Fixed in 5.17.14 with commit af2f1932743fb52ebcb008ad7ac500d9df0aa796 Fixed in 5.18.3 with commit 55b4dbb29054a05d839562f6d635ce05669b016d Fixed in 5.19 with commit c878bea3c9d724ddfa05a813f30de3d25a0ba83f 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-49348 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/super.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/cc5b09cb6dacd4b32640537929ab4ee8fb2b9e04 https://git.kernel.org/stable/c/b99fd73418350dea360da8311e87a6a7b0e15a4c https://git.kernel.org/stable/c/af2f1932743fb52ebcb008ad7ac500d9df0aa796 https://git.kernel.org/stable/c/55b4dbb29054a05d839562f6d635ce05669b016d https://git.kernel.org/stable/c/c878bea3c9d724ddfa05a813f30de3d25a0ba83f