[PATCH] AP MLD: reassign drv->ctx correctly to prevent hostapd crash

Aditya Kumar Singh quic_adisi at quicinc.com
Tue May 14 20:45:01 PDT 2024


On 5/14/24 06:50, Michael-CY Lee wrote:
> When the first link is deleted and there are still remaining links,
> drv->ctx should be updated to the new default link on the bss.
> Otherwise, drv->ctx points to the address that has already been freed
> and makes hostapd crash.
> 
> Fixes: d2b62b3fe500 ("AP MLD: Support link removal before removing interface")
> Signed-off-by: Michael-CY Lee <michael-cy.lee at mediatek.com>
> ---
>   src/drivers/driver_nl80211.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index 149f51a74..166aed7ad 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -10740,7 +10740,7 @@ static int driver_nl80211_link_remove(void *priv, enum wpa_driver_if_type type,
>   
>   	bss->ctx = bss->flink->ctx;
>   
> -	if (drv->first_bss == bss && !bss->valid_links)
> +	if (drv->first_bss == bss && bss->valid_links)
>   		drv->ctx = bss->ctx;
>   
>   	if (!bss->valid_links) {

Thanks for fixing this.



More information about the Hostap mailing list