Subject: CVE-2024-35912: wifi: iwlwifi: mvm: rfi: fix potential response leaks

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

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

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

wifi: iwlwifi: mvm: rfi: fix potential response leaks

If the rx payload length check fails, or if kmemdup() fails,
we still need to free the command response. Fix that.

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

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

	Issue introduced in 5.12 with commit 21254908cbe9 and fixed in 5.15.154 with commit 28db0ae86cb9
	Issue introduced in 5.12 with commit 21254908cbe9 and fixed in 6.1.85 with commit 99a75d750074
	Issue introduced in 5.12 with commit 21254908cbe9 and fixed in 6.6.26 with commit c0a40f2f8eba
	Issue introduced in 5.12 with commit 21254908cbe9 and fixed in 6.8.5 with commit f7f0e784894d
	Issue introduced in 5.12 with commit 21254908cbe9 and fixed in 6.9 with commit 06a093807eb7

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-35912
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/wireless/intel/iwlwifi/mvm/rfi.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/28db0ae86cb91a4ab0e855cff779daead936b7d5
	https://git.kernel.org/stable/c/99a75d75007421d8e08ba139e24f77395cd08f62
	https://git.kernel.org/stable/c/c0a40f2f8eba07416f695ffe2011bf3f8b0b6dc8
	https://git.kernel.org/stable/c/f7f0e784894dfcb265f0f9fa499103b0ca7eabde
	https://git.kernel.org/stable/c/06a093807eb7b5c5b29b6cff49f8174a4e702341