Subject: CVE-2024-49857: wifi: iwlwifi: mvm: set the cipher for secured NDP ranging

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

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

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

wifi: iwlwifi: mvm: set the cipher for secured NDP ranging

The cipher pointer is not set, but is derefereced trying to set its
content, which leads to a NULL pointer dereference.
Fix it by pointing to the cipher parameter before dereferencing.

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

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

	Issue introduced in 6.11 with commit 626be4bf99f6 and fixed in 6.11.2 with commit b3322a6d6aa9
	Issue introduced in 6.11 with commit 626be4bf99f6 and fixed in 6.12-rc1 with commit a949075d4bbf

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-49857
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/ftm-initiator.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/b3322a6d6aa9bc17b395c4b38d3b97578887aa8a
	https://git.kernel.org/stable/c/a949075d4bbf1ca83ccdeaa6ef4ac2ce7526c5f4