Subject: CVE-2022-48639: net: sched: fix possible refcount leak in tc_new_tfilter()

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

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

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

net: sched: fix possible refcount leak in tc_new_tfilter()

tfilter_put need to be called to put the refount got by tp->ops->get to
avoid possible refcount leak when chain->tmplt_ops != NULL and
chain->tmplt_ops != tp->ops.

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

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

	Issue introduced in 5.1 with commit 7d5509fa0d3d and fixed in 5.4.215 with commit 903f7d322c17
	Issue introduced in 5.1 with commit 7d5509fa0d3d and fixed in 5.10.146 with commit 8844c750eeb0
	Issue introduced in 5.1 with commit 7d5509fa0d3d and fixed in 5.15.71 with commit f8162aed962b
	Issue introduced in 5.1 with commit 7d5509fa0d3d and fixed in 5.19.12 with commit 0559d91ee3a2
	Issue introduced in 5.1 with commit 7d5509fa0d3d and fixed in 6.0 with commit c2e1cfefcac3

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-48639
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:
	net/sched/cls_api.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/903f7d322c17d8e306d766404b4604e81653902a
	https://git.kernel.org/stable/c/8844c750eeb03452e2b3319c27a526f447b82596
	https://git.kernel.org/stable/c/f8162aed962be8fa07445b2b5928e84ab40dd8d7
	https://git.kernel.org/stable/c/0559d91ee3a2cd81b15ad5cd507539d6da867f88
	https://git.kernel.org/stable/c/c2e1cfefcac35e0eea229e148c8284088ce437b5