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 A91661FCCF2 for ; Wed, 26 Feb 2025 02:12:52 +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=1740535972; cv=none; b=kB4FIchwd1BdJ+KwODKXLCViC1TmC1c9NLfBBWARMYApAoWoEPtF/rGj7xq0/S6jdeCGb9N+VEJBN4+/A3hHCLvgmvNE06H2/wvC6FxrpfZs/QTdswrEkpvhDrm4KDwasGVRZuNrEtfo58reBeQ7iQQli80Fryr8GzFjd33B2Vk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535972; c=relaxed/simple; bh=4dGO1GJ2wMuDys7UbiF9JuSu3MMskyuADnAq5HHVszk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mGeIXamU3mx0ssLhsw+1ZFQkHlmxEhptCTkADubuF7Hb1H62ufJj+k4+u5nCD+VZxH6zNtPKTHIdHWoRAJdQxV2aMbbI5QGK9/eZ9KL4ITJTv4QT4Z2avGBM/BRIINIDEwnaoE7GKM05cX7PzoNL51l3NveJwi6keNrNlEPMrBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TPdh343U; 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="TPdh343U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D71FC4CEDD; Wed, 26 Feb 2025 02:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535972; bh=4dGO1GJ2wMuDys7UbiF9JuSu3MMskyuADnAq5HHVszk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=TPdh343UYxAKYnNH6IJQjkTPAYiMstjvAxClKHHD/ZCtJCALlDoJ8jBnOffNcAEXi qPDrhnxmPwRuQ1w7IKBtdRP31/bo6awBIMWOv5ZYDHPo7pj3My363Lz/02aj1Bgy6p ob+ByAneTlxBYxKjMLbtKn9Ot2ei2rX8GcW+S8Qg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49317: f2fs: avoid infinite loop to flush node pages Date: Wed, 26 Feb 2025 03:09:51 +0100 Message-ID: <2025022637-CVE-2022-49317-0b90@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=3895; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4dGO1GJ2wMuDys7UbiF9JuSu3MMskyuADnAq5HHVszk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7yh9WOa17eGpjhoOr3rTwZSxaa7cvOv/9bYmJ40W7T UtzWu7e6IhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJyKkzLDi3/XTAhgl9hjpb ynm1O2LLGFWSLRnmGTbbxfw6t3R+S8mL1yusewwmsfyRBwA= 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: f2fs: avoid infinite loop to flush node pages xfstests/generic/475 can give EIO all the time which give an infinite loop to flush node page like below. Let's avoid it. [16418.518551] Call Trace: [16418.518553] ? dm_submit_bio+0x48/0x400 [16418.518574] ? submit_bio_checks+0x1ac/0x5a0 [16418.525207] __submit_bio+0x1a9/0x230 [16418.525210] ? kmem_cache_alloc+0x29e/0x3c0 [16418.525223] submit_bio_noacct+0xa8/0x2b0 [16418.525226] submit_bio+0x4d/0x130 [16418.525238] __submit_bio+0x49/0x310 [f2fs] [16418.525339] ? bio_add_page+0x6a/0x90 [16418.525344] f2fs_submit_page_bio+0x134/0x1f0 [f2fs] [16418.525365] read_node_page+0x125/0x1b0 [f2fs] [16418.525388] __get_node_page.part.0+0x58/0x3f0 [f2fs] [16418.525409] __get_node_page+0x2f/0x60 [f2fs] [16418.525431] f2fs_get_dnode_of_data+0x423/0x860 [f2fs] [16418.525452] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [16418.525458] ? __mod_memcg_state.part.0+0x2a/0x30 [16418.525465] ? __mod_memcg_lruvec_state+0x27/0x40 [16418.525467] ? __xa_set_mark+0x57/0x70 [16418.525472] f2fs_do_write_data_page+0x10e/0x7b0 [f2fs] [16418.525493] f2fs_write_single_data_page+0x555/0x830 [f2fs] [16418.525514] ? sysvec_apic_timer_interrupt+0x4e/0x90 [16418.525518] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [16418.525523] f2fs_write_cache_pages+0x303/0x880 [f2fs] [16418.525545] ? blk_flush_plug_list+0x47/0x100 [16418.525548] f2fs_write_data_pages+0xfd/0x320 [f2fs] [16418.525569] do_writepages+0xd5/0x210 [16418.525648] filemap_fdatawrite_wbc+0x7d/0xc0 [16418.525655] filemap_fdatawrite+0x50/0x70 [16418.525658] f2fs_sync_dirty_inodes+0xa4/0x230 [f2fs] [16418.525679] f2fs_write_checkpoint+0x16d/0x1720 [f2fs] [16418.525699] ? ttwu_do_wakeup+0x1c/0x160 [16418.525709] ? ttwu_do_activate+0x6d/0xd0 [16418.525711] ? __wait_for_common+0x11d/0x150 [16418.525715] kill_f2fs_super+0xca/0x100 [f2fs] [16418.525733] deactivate_locked_super+0x3b/0xb0 [16418.525739] deactivate_super+0x40/0x50 [16418.525741] cleanup_mnt+0x139/0x190 [16418.525747] __cleanup_mnt+0x12/0x20 [16418.525749] task_work_run+0x6d/0xa0 [16418.525765] exit_to_user_mode_prepare+0x1ad/0x1b0 [16418.525771] syscall_exit_to_user_mode+0x27/0x50 [16418.525774] do_syscall_64+0x48/0xc0 [16418.525776] entry_SYSCALL_64_after_hwframe+0x44/0xae The Linux kernel CVE team has assigned CVE-2022-49317 to this issue. Affected and fixed versions =========================== Fixed in 5.18.4 with commit bd47ea5d776d8b524fb6f60de3240f95603901dd Fixed in 5.19 with commit a7b8618aa2f0f926ce85f2486ac835a85c753ca7 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-49317 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/node.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/bd47ea5d776d8b524fb6f60de3240f95603901dd https://git.kernel.org/stable/c/a7b8618aa2f0f926ce85f2486ac835a85c753ca7