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 8353830F813 for ; Mon, 15 Sep 2025 14:21:35 +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=1757946095; cv=none; b=T7/3oB98vkcuIuNP8KWZwyAa7pxGvytckxZ6hkRR6vZiEwJLYxbIyujWeM+uRSuAXqUc9di+HSSFQloECit+x2iqRpEbvmU0vkqze7lthHZYJs1tpEWn2uHCVOjyBVFVroaCFo2IjYz0kb72ZZRmoKNlL0HbqLc9FwMGiay3EgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757946095; c=relaxed/simple; bh=cxjyfiq3OKuTVOI9/8g2qUkNIXJWK3luPfwFvBPiV4c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qxlPcebCcCSI5LviA60j9JQ1WkItWsVIFtuTtb42u37on/vPiLMzlZCmeeR2A+cKQFuAKAzHYHT6w2B6QAvitUchVFednUvGXYA5vDoc2aky3aDbJeVPXRVywh7mRyuNA0cxyoKWPuqmaVY42rAbU6tL7Qq6tXxsUUNWwKdzpAU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Rpfqgf35; 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="Rpfqgf35" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68F03C4CEF1; Mon, 15 Sep 2025 14:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757946095; bh=cxjyfiq3OKuTVOI9/8g2qUkNIXJWK3luPfwFvBPiV4c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Rpfqgf35Vg1WcOgOueNQQSq/I1MvsiQ6NaeeH5dAlkS5gLiER4435hwJ53wap0KiP bQI6PHFfMDfX5Jbp7ETTtTdi4lHPqnygL/b1UbtdgUh7HR/WDwSGWwn7DGe26Kxs9o YuiV13Ygwr1lPNMaTF5OuREVgTHhcKfvZkr3lzfE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50273: f2fs: fix to do sanity check on destination blkaddr during recovery Date: Mon, 15 Sep 2025 16:21:15 +0200 Message-ID: <2025091505-CVE-2022-50273-5521@gregkh> X-Mailer: git-send-email 2.51.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=3881; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=8FubLb1YHIwYzGG2B5F6NTPVfgQnq8rjx72uVYuXv6Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknFC5+Xn90sbfR4pXy83mNanzKjdfPVzP9/Ew2JVR46 w6p8IssHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRXAeG+fnxs59PLYrfyWr4 YzNv+12tTGVOWYa54r6H9OYstD2sVJ2bZfdA2+25vfJCAA== 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: f2fs: fix to do sanity check on destination blkaddr during recovery As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216456 loop5: detected capacity change from 0 to 131072 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): Bitmap was wrongly set, blk:5634 ------------[ cut here ]------------ WARNING: CPU: 3 PID: 1013 at fs/f2fs/segment.c:2198 RIP: 0010:update_sit_entry+0xa55/0x10b0 [f2fs] Call Trace: f2fs_do_replace_block+0xa98/0x1890 [f2fs] f2fs_replace_block+0xeb/0x180 [f2fs] recover_data+0x1a69/0x6ae0 [f2fs] f2fs_recover_fsync_data+0x120d/0x1fc0 [f2fs] f2fs_fill_super+0x4665/0x61e0 [f2fs] mount_bdev+0x2cf/0x3b0 legacy_get_tree+0xed/0x1d0 vfs_get_tree+0x81/0x2b0 path_mount+0x47e/0x19d0 do_mount+0xce/0xf0 __x64_sys_mount+0x12c/0x1a0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd If we enable CONFIG_F2FS_CHECK_FS config, it will trigger a kernel panic instead of warning. The root cause is: in fuzzed image, SIT table is inconsistent with inode mapping table, result in triggering such warning during SIT table update. This patch introduces a new flag DATA_GENERIC_ENHANCE_UPDATE, w/ this flag, data block recovery flow can check destination blkaddr's validation in SIT table, and skip f2fs_replace_block() to avoid inconsistent status. The Linux kernel CVE team has assigned CVE-2022-50273 to this issue. Affected and fixed versions =========================== Fixed in 5.4.220 with commit 68b1e607559d3dc85f94b0d738d7c4e8029b0cfa Fixed in 5.10.150 with commit 73fb4bd2c055a393816f078f158cdd3025006f1d Fixed in 5.15.75 with commit ed854f10e6afd5cbd5c3274d4c4df4bfe0ab4362 Fixed in 5.19.17 with commit 8f0a47def4722c5fd8d6b9268b5ffed8a249e2db Fixed in 6.0.3 with commit 3a4d24d746866dd45d970bd565ff3886e839366a Fixed in 6.1 with commit 0ef4ca04a3f9223ff8bc440041c524b2123e09a3 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-50273 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/f2fs/checkpoint.c fs/f2fs/f2fs.h fs/f2fs/recovery.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/68b1e607559d3dc85f94b0d738d7c4e8029b0cfa https://git.kernel.org/stable/c/73fb4bd2c055a393816f078f158cdd3025006f1d https://git.kernel.org/stable/c/ed854f10e6afd5cbd5c3274d4c4df4bfe0ab4362 https://git.kernel.org/stable/c/8f0a47def4722c5fd8d6b9268b5ffed8a249e2db https://git.kernel.org/stable/c/3a4d24d746866dd45d970bd565ff3886e839366a https://git.kernel.org/stable/c/0ef4ca04a3f9223ff8bc440041c524b2123e09a3