Subject: CVE-2024-39470: eventfs: Fix a possible null pointer dereference in eventfs_find_events()

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

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

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

eventfs: Fix a possible null pointer dereference in eventfs_find_events()

In function eventfs_find_events,there is a potential null pointer
that may be caused by calling update_events_attr which will perform
some operations on the members of the ei struct when ei is NULL.

Hence,When ei->is_freed is set,return NULL directly.

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

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

	Issue introduced in 6.6.18 with commit 628adb842bd5 and fixed in 6.6.34 with commit 5ade5fbdbbb1
	Issue introduced in 6.8 with commit 8186fff7ab64 and fixed in 6.9.5 with commit 7a1b2d138189
	Issue introduced in 6.8 with commit 8186fff7ab64 and fixed in 6.10 with commit d4e9a968738b
	Issue introduced in 6.7.4 with commit 9c2ac5e0ea78

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-39470
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/tracefs/event_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/5ade5fbdbbb1f023bb70730ba4d74146c8bc7eb9
	https://git.kernel.org/stable/c/7a1b2d138189375ed1dcd7d0851118230221bd1d
	https://git.kernel.org/stable/c/d4e9a968738bf66d3bb852dd5588d4c7afd6d7f4