Subject: CVE-2024-50055: driver core: bus: Fix double free in driver API bus_register()

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

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

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

driver core: bus: Fix double free in driver API bus_register()

For bus_register(), any error which happens after kset_register() will
cause that @priv are freed twice, fixed by setting @priv with NULL after
the first free.

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

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

	Fixed in 6.6.57 with commit d885c464c250
	Fixed in 6.11.4 with commit 9ce15f68abed
	Fixed in 6.12-rc1 with commit bfa54a793ba7

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-50055
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:
	drivers/base/bus.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/d885c464c25018b81a6b58f5d548fc2e3ef87dd1
	https://git.kernel.org/stable/c/9ce15f68abedfae7ae0a35e95895aeddfd0f0c6a
	https://git.kernel.org/stable/c/bfa54a793ba77ef696755b66f3ac4ed00c7d1248