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 D49411991D4 for ; Mon, 21 Oct 2024 18:02:53 +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=1729533773; cv=none; b=rnSvaK54LsQsbDE2+M3X9Pw0RqGwVkhnyVrEca8pkv219/5VwSX1irAS5o2C2wJ+qTjEqBUQcIZ1I5LfkBCehKMExKt8JPeUDXZzAAn/kI9wYKLT1vPf9svXH03H15Q5QWFmlOwTbGSiYCdL4ae1xxmnAeSSWUHcMMi0P/w2Kzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729533773; c=relaxed/simple; bh=pWXPyfFJ0p0Owph4SEe7qSOBBzTZgu2amj0oXd8UyaY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UHO0jX4eXU+Zup00E2IUBF5+ckG1VWjq1MiLs3NoMkI0/c+pMVU7Fy9cNeGisX7JoLXjYDAWT552/Pxgb+ZddDLyyDCqHPdswxi+IW/2f8BZvJUoNhTMGVkLvNuoSz3b+JT5QI5Bgj/BE89jfxPNnX0/iIeg3FNHmTpIz5Erz3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JusCtj3h; 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="JusCtj3h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54BC4C4CEC7; Mon, 21 Oct 2024 18:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729533773; bh=pWXPyfFJ0p0Owph4SEe7qSOBBzTZgu2amj0oXd8UyaY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=JusCtj3hAflSynaylAfntFaAHAx2VJXwJMY53JuDJGrXfDkCfldshIVbkKQrgBrmq 0rfkOl6WaKJyGBkOR5dpiMbETdl2p/dM11RWrEk5SSJYh7oIzoICPOV5xLJWeJSyTB JdpuNBEn+TwoSxMM7VeF3ULjLOfOitbY3L4puaag= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49887: f2fs: fix to don't panic system for no free segment fault injection Date: Mon, 21 Oct 2024 20:01:35 +0200 Message-ID: <2024102117-CVE-2024-49887-04ba@gregkh> X-Mailer: git-send-email 2.47.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=3260; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pWXPyfFJ0p0Owph4SEe7qSOBBzTZgu2amj0oXd8UyaY=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli094ydv6r+XMh7n3WqWjTHV8CL6rovLaUW7PQ+PXWZ K/FH2+ndcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEZv9kmJ++5RX/88knFSIl JBYVf15ku3CH0AOG+R69silOTxgevmB6aTWlVCwmeN+vwwA= 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: fix to don't panic system for no free segment fault injection f2fs: fix to don't panic system for no free segment fault injection syzbot reports a f2fs bug as below: F2FS-fs (loop0): inject no free segment in get_new_segment of __allocate_new_segment+0x1ce/0x940 fs/f2fs/segment.c:3167 F2FS-fs (loop0): Stopped filesystem due to reason: 7 ------------[ cut here ]------------ kernel BUG at fs/f2fs/segment.c:2748! CPU: 0 UID: 0 PID: 5109 Comm: syz-executor304 Not tainted 6.11.0-rc6-syzkaller-00363-g89f5e14d05b4 #0 RIP: 0010:get_new_segment fs/f2fs/segment.c:2748 [inline] RIP: 0010:new_curseg+0x1f61/0x1f70 fs/f2fs/segment.c:2836 Call Trace: __allocate_new_segment+0x1ce/0x940 fs/f2fs/segment.c:3167 f2fs_allocate_new_section fs/f2fs/segment.c:3181 [inline] f2fs_allocate_pinning_section+0xfa/0x4e0 fs/f2fs/segment.c:3195 f2fs_expand_inode_data+0x5d6/0xbb0 fs/f2fs/file.c:1799 f2fs_fallocate+0x448/0x960 fs/f2fs/file.c:1903 vfs_fallocate+0x553/0x6c0 fs/open.c:334 do_vfs_ioctl+0x2592/0x2e50 fs/ioctl.c:886 __do_sys_ioctl fs/ioctl.c:905 [inline] __se_sys_ioctl+0x81/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0010:get_new_segment fs/f2fs/segment.c:2748 [inline] RIP: 0010:new_curseg+0x1f61/0x1f70 fs/f2fs/segment.c:2836 The root cause is when we inject no free segment fault into f2fs, we should not panic system, fix it. The Linux kernel CVE team has assigned CVE-2024-49887 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 8b10d3653735 and fixed in 6.10.14 with commit 9f6e7a0512a5 Issue introduced in 6.9 with commit 8b10d3653735 and fixed in 6.11.3 with commit 645ec43760e8 Issue introduced in 6.9 with commit 8b10d3653735 and fixed in 6.12-rc1 with commit 65a6ce4726c2 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-49887 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/segment.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/9f6e7a0512a57387d36f5e9e9635d6668cac13dd https://git.kernel.org/stable/c/645ec43760e86d3079fee2e8b51fde7060a540d0 https://git.kernel.org/stable/c/65a6ce4726c27b45600303f06496fef46d00b57f