Re: [PATCH] wifi: brcmfmac: Fix potential use-after-free on monitor registration failure

From: Arend van Spriel

Date: Tue Nov 24 2026 - 15:14:22 EST


On Mon, 16 Nov 2026 22:13:24 +0800, Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx> wrote:
> A failed netdevice registration can invoke priv_destructor while
> cfg80211_register_netdevice() still needs the wireless_dev embedded in
> the vif. The caller also frees the vif on this error path.
>
> Install the destructor only after registration succeeds, as done for
> regular interfaces, and leave failed registration cleanup to the caller.
>
> This issue was found by our static analysis tool under development.
> Fixes: 20f2c5fa3af0 ("brcmfmac: add initial support for monitor mode")
> Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx>

Regards,
Arend