Subject: CVE-2024-45002: rtla/osnoise: Prevent NULL dereference in error handling

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

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

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

rtla/osnoise: Prevent NULL dereference in error handling

If the "tool->data" allocation fails then there is no need to call
osnoise_free_top() and, in fact, doing so will lead to a NULL dereference.

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

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

	Issue introduced in 5.17 with commit 1eceb2fc2ca5 and fixed in 6.1.107 with commit fc575212c6b7
	Issue introduced in 5.17 with commit 1eceb2fc2ca5 and fixed in 6.6.48 with commit 753f1745146e
	Issue introduced in 5.17 with commit 1eceb2fc2ca5 and fixed in 6.10.7 with commit abdb9ddaaab4
	Issue introduced in 5.17 with commit 1eceb2fc2ca5 and fixed in 6.11 with commit 90574d2a6759

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-45002
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:
	tools/tracing/rtla/src/osnoise_top.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/fc575212c6b75d538e1a0a74f4c7e2ac73bc46ac
	https://git.kernel.org/stable/c/753f1745146e03abd17eec8eee95faffc96d743d
	https://git.kernel.org/stable/c/abdb9ddaaab476e62805e36cce7b4ef8413ffd01
	https://git.kernel.org/stable/c/90574d2a675947858b47008df8d07f75ea50d0d0