Subject: CVE-2024-46831: net: microchip: vcap: Fix use-after-free error in kunit test

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

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

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

net: microchip: vcap: Fix use-after-free error in kunit test

This is a clear use-after-free error. We remove it, and rely on checking
the return code of vcap_del_rule.

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

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

	Issue introduced in 6.2 with commit c956b9b318d9 and fixed in 6.6.51 with commit b0804c286ccf
	Issue introduced in 6.2 with commit c956b9b318d9 and fixed in 6.10.10 with commit f7fe95f40c85
	Issue introduced in 6.2 with commit c956b9b318d9 and fixed in 6.11 with commit a3c1e45156ad

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-46831
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/ethernet/microchip/vcap/vcap_api_kunit.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/b0804c286ccfcf5f5c004d5bf8a54c0508b5e86b
	https://git.kernel.org/stable/c/f7fe95f40c85311c98913fe6ae2c56adb7f767a7
	https://git.kernel.org/stable/c/a3c1e45156ad39f225cd7ddae0f81230a3b1e657