kernel_samsung_a53x/drivers/net/wireless
Zheng Wang c82abfa57d wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach
[ Upstream commit 0f7352557a35ab7888bc7831411ec8a3cbe20d78 ]

This is the candidate patch of CVE-2023-47233 :
https://nvd.nist.gov/vuln/detail/CVE-2023-47233

In brcm80211 driver,it starts with the following invoking chain
to start init a timeout worker:

->brcmf_usb_probe
  ->brcmf_usb_probe_cb
    ->brcmf_attach
      ->brcmf_bus_started
        ->brcmf_cfg80211_attach
          ->wl_init_priv
            ->brcmf_init_escan
              ->INIT_WORK(&cfg->escan_timeout_work,
		  brcmf_cfg80211_escan_timeout_worker);

If we disconnect the USB by hotplug, it will call
brcmf_usb_disconnect to make cleanup. The invoking chain is :

brcmf_usb_disconnect
  ->brcmf_usb_disconnect_cb
    ->brcmf_detach
      ->brcmf_cfg80211_detach
        ->kfree(cfg);

While the timeout woker may still be running. This will cause
a use-after-free bug on cfg in brcmf_cfg80211_escan_timeout_worker.

Fix it by deleting the timer and canceling the worker in
brcmf_cfg80211_detach.

Fixes: e756af5b30b0 ("brcmfmac: add e-scan support.")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Cc: stable@vger.kernel.org
[arend.vanspriel@broadcom.com: keep timer delete as is and cancel work just before free]
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240107072504.392713-1-arend.vanspriel@broadcom.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 09:22:14 +01:00
..
admtek Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ath wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
atmel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
broadcom wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach 2024-11-19 09:22:14 +01:00
cisco Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cnss2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cnss_genl Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cnss_prealloc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cnss_utils Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
intersil Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
marvell wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
mediatek wifi: mt76: replace skb_put with skb_put_zero 2024-10-04 20:09:30 -03:00
microchip wifi: wilc1000: prevent use-after-free on vif when cleaning up all interfaces 2024-11-19 08:44:45 +01:00
qualcomm/qca6490 qcacld-3.0: Disable auto IRQ affinity feature 2024-11-17 17:44:53 +01:00
quantenna wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
ralink wifi: rt2x00: restart beacon queue when hardware reset 2024-11-18 12:13:11 +01:00
realtek wifi: rtw88: 8821c: Fix false alarm count 2024-11-19 08:44:48 +01:00
rsi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scsc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
st wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
ti Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
zydas Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mac80211_hwsim.c wifi: mac80211_hwsim: fix clang-specific fortify warning 2024-11-18 11:43:12 +01:00
mac80211_hwsim.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ray_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ray_cs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rayctl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rndis_wlan.c wireless: Remove redundant 'flush_workqueue()' calls 2024-11-19 08:44:44 +01:00
virt_wifi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wl3501.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wl3501_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00