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 23ED5817 for ; Wed, 17 Apr 2024 10:30:57 +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=1713349857; cv=none; b=QPQHP+nlGd58T+qtI8/NjkWfa45qj4WKrw/qjQxq88QMYYjukdggJfywJ9bIc/p3SyAGKdqVczKJuHQFa3ImVXLrqV5UtylIzdvd0wi/EygevrvOQJpAbZAxG5bH4aHn/YZyXAdqKz4LNO3Fe0GHo+fdjw6XOjOGlETG5/bEATI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713349857; c=relaxed/simple; bh=LNQsJEb4S2Lt+Q9cDGiw6w0b7rqJ9aaRU21KbAPii5I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DkzAeQMyPw91qCmKZjoLmCZcybxUOgBEvaFIQvmF8eio397Z+UipcyOsmQxOfL6jHrQ28zgJ3Q+PIzsLFtR+xqGqmcaoQCPNJQwnlmR2V2USmd24qbUK6aFkhsSHfGXBCjK51+Y7cTT9RqmPGBjFCXSOi4vh+Foe19kzUuV0vAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=krelqIYk; 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="krelqIYk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AE52C072AA; Wed, 17 Apr 2024 10:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713349857; bh=LNQsJEb4S2Lt+Q9cDGiw6w0b7rqJ9aaRU21KbAPii5I=; h=From:To:Cc:Subject:Date:Reply-to:From; b=krelqIYk74C0F4IC39uvtEpjo1lLPCQ+RXN4DIO0VzYdhAUmezzn1cyKcNL/HpBNd 3/fNr4orq+hjdZ6B/1fHaYzn1GJ6UKBz5Tt24zgORxmXltk821aP+bD0ren4GRloA8 Wf/PTS4e5nK2cCEypL/4K/XJrXvzY6x8+rJo5wIk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26869: f2fs: fix to truncate meta inode pages forcely Date: Wed, 17 Apr 2024 12:28:44 +0200 Message-ID: <2024041738-CVE-2024-26869-c9e2@gregkh> X-Mailer: git-send-email 2.44.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=2823; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=LNQsJEb4S2Lt+Q9cDGiw6w0b7rqJ9aaRU21KbAPii5I=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnyS8IYXec/XPKfae7hyXcv9i9ijAjdNuuk09xP7E80t l812bSuqSOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmMvM+w1xJ5Xbd2fvEnldJ H78kd3A/Y9OmDn+GeYoXnCOUlkg86N38s5s1/5VYSndgEAA= 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 truncate meta inode pages forcely Below race case can cause data corruption: Thread A GC thread - gc_data_segment - ra_data_block - locked meta_inode page - f2fs_inplace_write_data - invalidate_mapping_pages : fail to invalidate meta_inode page due to lock failure or dirty|writeback status - f2fs_submit_page_bio : write last dirty data to old blkaddr - move_data_block - load old data from meta_inode page - f2fs_submit_page_write : write old data to new blkaddr Because invalidate_mapping_pages() will skip invalidating page which has unclear status including locked, dirty, writeback and so on, so we need to use truncate_inode_pages_range() instead of invalidate_mapping_pages() to make sure meta_inode page will be dropped. The Linux kernel CVE team has assigned CVE-2024-26869 to this issue. Affected and fixed versions =========================== Issue introduced in 4.19 with commit 6aa58d8ad20a and fixed in 6.6.23 with commit c92f2927df86 Issue introduced in 4.19 with commit 6aa58d8ad20a and fixed in 6.7.11 with commit 77bfdb89cc22 Issue introduced in 4.19 with commit 6aa58d8ad20a and fixed in 6.8.2 with commit 04226d8e3c40 Issue introduced in 4.19 with commit 6aa58d8ad20a and fixed in 6.9-rc1 with commit 9f0c4a46be1f 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-26869 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/segment.c include/linux/f2fs_fs.h 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/c92f2927df860a60ba815d3ee610a944b92a8694 https://git.kernel.org/stable/c/77bfdb89cc222fc7bfe198eda77bdc427d5ac189 https://git.kernel.org/stable/c/04226d8e3c4028dc451e9d8777356ec0f7919253 https://git.kernel.org/stable/c/9f0c4a46be1fe9b97dbe66d49204c1371e3ece65