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 26204B66C for ; Mon, 26 Aug 2024 11:21:41 +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=1724671301; cv=none; b=okrFYszVlX34zhEBZbqQDNxXrnjSLnE6srJ6WFggVNNTBtTyDOlfR//ZxQNDXDUuod4HLEWpBkmR5+ubD1QMIdNb5//XaGsI7iTA3ivLtA0eAWQ7Kp/t3sIY3icCyh9G+Yffvk0nVx6MxniUwCV9afijwPPj7HFKIBhiATlmQy0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724671301; c=relaxed/simple; bh=A6+MOE/5HfDRXStj1SbFnt8ZoTzVwpVBcpY3ffzEzRQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KKorgveTuj1grCBQBQm9TGYLqFd5lvVzpKOhNp06Vuq0HucrSCGmoGS9Zo5cGKMqEUPmu86iv7hgNudx8u88QDE45uU1Q+SmJlC4nOe4WdHm2cvZ4expANg8yqV8gHfNE7kE9Mei5apyDt0GvW7Q9EM51hTfeSbaFBmqOCDXvFY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=n0iadh3a; 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="n0iadh3a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8124AC4AF62; Mon, 26 Aug 2024 11:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724671301; bh=A6+MOE/5HfDRXStj1SbFnt8ZoTzVwpVBcpY3ffzEzRQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=n0iadh3axYg2RgiugVY4IsLpXgeCIzOrQqNLddZHmatAJwoRRngrfJIduXD8W8Xea VfpU/oRNp9o0JU0B+gskaj1fd2azh2rhmGXYSklXD/mZu0GMF7BcaN2YnjZBzoZy33 /whAFaRkigHNke2RafuGIsDWpzUJBKuTz3y7M8Ac= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-44942: f2fs: fix to do sanity check on F2FS_INLINE_DATA flag in inode during GC Date: Mon, 26 Aug 2024 13:21:21 +0200 Message-ID: <2024082620-CVE-2024-44942-651a@gregkh> X-Mailer: git-send-email 2.46.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=3202; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=A6+MOE/5HfDRXStj1SbFnt8ZoTzVwpVBcpY3ffzEzRQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlnUg227T8lVvv5VWW5fSTrl+tf2LWOplgdE/JZE/fQP 1wjMJO/I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbCzscwm+VMuGbCOrbrUywP lf8NuNn4rL3ZhmG+J8sdzdd7NbQ74s8f5/uodOWp/uP1AA== 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 do sanity check on F2FS_INLINE_DATA flag in inode during GC syzbot reports a f2fs bug as below: ------------[ cut here ]------------ kernel BUG at fs/f2fs/inline.c:258! CPU: 1 PID: 34 Comm: kworker/u8:2 Not tainted 6.9.0-rc6-syzkaller-00012-g9e4bc4bcae01 #0 RIP: 0010:f2fs_write_inline_data+0x781/0x790 fs/f2fs/inline.c:258 Call Trace: f2fs_write_single_data_page+0xb65/0x1d60 fs/f2fs/data.c:2834 f2fs_write_cache_pages fs/f2fs/data.c:3133 [inline] __f2fs_write_data_pages fs/f2fs/data.c:3288 [inline] f2fs_write_data_pages+0x1efe/0x3a90 fs/f2fs/data.c:3315 do_writepages+0x35b/0x870 mm/page-writeback.c:2612 __writeback_single_inode+0x165/0x10b0 fs/fs-writeback.c:1650 writeback_sb_inodes+0x905/0x1260 fs/fs-writeback.c:1941 wb_writeback+0x457/0xce0 fs/fs-writeback.c:2117 wb_do_writeback fs/fs-writeback.c:2264 [inline] wb_workfn+0x410/0x1090 fs/fs-writeback.c:2304 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa12/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f2/0x390 kernel/kthread.c:388 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The root cause is: inline_data inode can be fuzzed, so that there may be valid blkaddr in its direct node, once f2fs triggers background GC to migrate the block, it will hit f2fs_bug_on() during dirty page writeback. Let's add sanity check on F2FS_INLINE_DATA flag in inode during GC, so that, it can forbid migrating inline_data inode's data block for fixing. The Linux kernel CVE team has assigned CVE-2024-44942 to this issue. Affected and fixed versions =========================== Fixed in 6.6.47 with commit ae00e6536a2d Fixed in 6.10.6 with commit 26c07775fb5d Fixed in 6.11-rc1 with commit fc01008c92f4 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-44942 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/gc.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/ae00e6536a2dd54b64b39e9a39548870cf835745 https://git.kernel.org/stable/c/26c07775fb5dc74351d1c3a2bc3cdf609b03e49f https://git.kernel.org/stable/c/fc01008c92f40015aeeced94750855a7111b6929