Subject: CVE-2024-27391: wifi: wilc1000: do not realloc workqueue everytime an interface is added

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

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

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

wifi: wilc1000: do not realloc workqueue everytime an interface is added

Commit 09ed8bfc5215 ("wilc1000: Rename workqueue from "WILC_wq" to
"NETDEV-wq"") moved workqueue creation in wilc_netdev_ifc_init in order to
set the interface name in the workqueue name. However, while the driver
needs only one workqueue, the wilc_netdev_ifc_init is called each time we
add an interface over a phy, which in turns overwrite the workqueue with a
new one. This can be observed with the following commands:

for i in $(seq 0 10)
do
  iw phy phy0 interface add wlan1 type managed
  iw dev wlan1 del
done
ps -eo pid,comm|grep wlan

 39 kworker/R-wlan0
 98 kworker/R-wlan1
102 kworker/R-wlan1
105 kworker/R-wlan1
108 kworker/R-wlan1
111 kworker/R-wlan1
114 kworker/R-wlan1
117 kworker/R-wlan1
120 kworker/R-wlan1
123 kworker/R-wlan1
126 kworker/R-wlan1
129 kworker/R-wlan1

Fix this leakage by putting back hif_workqueue allocation in
wilc_cfg80211_init. Regarding the workqueue name, it is indeed relevant to
set it lowercase, however it is not  attached to a specific netdev, so
enforcing netdev name in the name is not so relevant. Still, enrich the
name with the wiphy name to make it clear which phy is using the workqueue.

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

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

	Issue introduced in 5.17 with commit 09ed8bfc5215 and fixed in 6.1.83 with commit 515cc676dfbc
	Issue introduced in 5.17 with commit 09ed8bfc5215 and fixed in 6.6.23 with commit 4041c60a9d54
	Issue introduced in 5.17 with commit 09ed8bfc5215 and fixed in 6.7.11 with commit 90ae293d1d25
	Issue introduced in 5.17 with commit 09ed8bfc5215 and fixed in 6.8.2 with commit 9ab0c303ccab
	Issue introduced in 5.17 with commit 09ed8bfc5215 and fixed in 6.9 with commit 328efda22af8

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-27391
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/microchip/wilc1000/cfg80211.c
	drivers/net/wireless/microchip/wilc1000/netdev.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/515cc676dfbce40d93c92b1ff3c1070e917f4e52
	https://git.kernel.org/stable/c/4041c60a9d543b3ad50225385b072ba68e96166e
	https://git.kernel.org/stable/c/90ae293d1d255f622318fce6eeea2e18f9fde5c1
	https://git.kernel.org/stable/c/9ab0c303ccabfd6bdce14432792d41090070008c
	https://git.kernel.org/stable/c/328efda22af81130c2ad981c110518cb29ff2f1d