Subject: CVE-2024-26955: nilfs2: prevent kernel bug at submit_bh_wbc()

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

nilfs2: prevent kernel bug at submit_bh_wbc()

Fix a bug where nilfs_get_block() returns a successful status when
searching and inserting the specified block both fail inconsistently.  If
this inconsistent behavior is not due to a previously fixed bug, then an
unexpected race is occurring, so return a temporary error -EAGAIN instead.

This prevents callers such as __block_write_begin_int() from requesting a
read into a buffer that is not mapped, which would cause the BUG_ON check
for the BH_Mapped flag in submit_bh_wbc() to fail.

The Linux kernel CVE team has assigned CVE-2024-26955 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 4.19.312 with commit 91e4c4595fae
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 5.4.274 with commit 32eaee72e965
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 5.10.215 with commit f0fe7ad5aff4
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 5.15.154 with commit ca581d237f3b
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 6.1.84 with commit 192e9f9078c9
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 6.6.24 with commit 0c8aa4cfda4e
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 6.7.12 with commit 48d443d20023
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 6.8.3 with commit 76ffbe911e27
	Issue introduced in 2.6.30 with commit 1f5abe7e7dbc and fixed in 6.9 with commit 269cdf353b5b

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-26955
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/nilfs2/inode.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/91e4c4595fae5e87069e44687ae879091783c183
	https://git.kernel.org/stable/c/32eaee72e96590a75445c8a6c7c1057673b47e07
	https://git.kernel.org/stable/c/f0fe7ad5aff4f0fcf988913313c497de85f1e186
	https://git.kernel.org/stable/c/ca581d237f3b8539c044205bb003de71d75d227c
	https://git.kernel.org/stable/c/192e9f9078c96be30b31c4b44d6294b24520fce5
	https://git.kernel.org/stable/c/0c8aa4cfda4e4adb15d5b6536d155eca9c9cd44c
	https://git.kernel.org/stable/c/48d443d200237782dc82e6b60663ec414ef02e39
	https://git.kernel.org/stable/c/76ffbe911e2798c7296968f5fd72f7bf67207a8d
	https://git.kernel.org/stable/c/269cdf353b5bdd15f1a079671b0f889113865f20