Subject: CVE-2024-26604: Revert "kobject: Remove redundant checks for whether ktype is NULL"

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

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

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

Revert "kobject: Remove redundant checks for whether ktype is NULL"

This reverts commit 1b28cb81dab7c1eedc6034206f4e8d644046ad31.

It is reported to cause problems, so revert it for now until the root
cause can be found.

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

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

	Issue introduced in 6.6 with commit 1b28cb81dab7 and fixed in 6.6.18 with commit 7f414d306320
	Issue introduced in 6.6 with commit 1b28cb81dab7 and fixed in 6.7.6 with commit b746d52ce7bc
	Issue introduced in 6.6 with commit 1b28cb81dab7 and fixed in 6.8 with commit 3ca8fbabcceb

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-26604
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:
	lib/kobject.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/7f414d306320f837cc3df96cf52161cb8290fb1b
	https://git.kernel.org/stable/c/b746d52ce7bcac325a2fa264216ead85b7fbbfaa
	https://git.kernel.org/stable/c/3ca8fbabcceb8bfe44f7f50640092fd8f1de375c