Subject: CVE-2024-47670: ocfs2: add bounds checking to ocfs2_xattr_find_entry()

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

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

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

ocfs2: add bounds checking to ocfs2_xattr_find_entry()

Add a paranoia check to make sure it doesn't stray beyond valid memory
region containing ocfs2 xattr entries when scanning for a match.  It will
prevent out-of-bound access in case of crafted images.

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

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

	Fixed in 5.10.227 with commit 34759b7e4493
	Fixed in 5.15.168 with commit 5bbe51eaf01a
	Fixed in 6.1.112 with commit 9b32539590a8
	Fixed in 6.6.53 with commit 1f6e167d6753
	Fixed in 6.10.12 with commit 8e7bef408261
	Fixed in 6.11 with commit 9e3041fecdc8

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-47670
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/ocfs2/xattr.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/34759b7e4493d7337cbc414c132cef378c492a2c
	https://git.kernel.org/stable/c/5bbe51eaf01a5dd6fb3f0dea81791e5dbc6dc6dd
	https://git.kernel.org/stable/c/9b32539590a8e6400ac2f6e7cf9cbb8e08711a2f
	https://git.kernel.org/stable/c/1f6e167d6753fe3ea493cdc7f7de8d03147a4d39
	https://git.kernel.org/stable/c/8e7bef408261746c160853fc27df3139659f5f77
	https://git.kernel.org/stable/c/9e3041fecdc8f78a5900c3aa51d3d756e73264d6