Subject: CVE-2022-48955: net: thunderbolt: fix memory leak in tbnet_open()

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

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

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

net: thunderbolt: fix memory leak in tbnet_open()

When tb_ring_alloc_rx() failed in tbnet_open(), ida that allocated in
tb_xdomain_alloc_out_hopid() is not released. Add
tb_xdomain_release_out_hopid() to the error path to release ida.

The Linux kernel CVE team has assigned CVE-2022-48955 to this issue.

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

	Issue introduced in 5.13 with commit 180b0689425c and fixed in 5.15.83 with commit b9274dbe3999
	Issue introduced in 5.13 with commit 180b0689425c and fixed in 6.0.13 with commit ed6e955f3b7e
	Issue introduced in 5.13 with commit 180b0689425c and fixed in 6.1 with commit ed14e5903638

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-2022-48955
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/net/thunderbolt.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/b9274dbe399952a8175db2e1ee148b7c9ba2b538
	https://git.kernel.org/stable/c/ed6e955f3b7e0e622c080f4bcb5427a5e1af4c2a
	https://git.kernel.org/stable/c/ed14e5903638f6eb868e3e2b4e610985e6a6c876