From 7365e8f1bb5eb4c4fc6b8a03e0f7bed2c7b7b523 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 13 Sep 2023 17:07:17 +0200 Subject: [PATCH] hostapd: do not modify hapd->started when stopping an AP It can cause cleanup to be skipped on wifi restart, which can lead to use-after-free bugs Signed-off-by: Felix Fietkau --- package/network/services/hostapd/src/src/ap/ucode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index 849f8028e6..3dc122b7c2 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -394,7 +394,7 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs) struct hostapd_data *hapd = iface->bss[i]; hostapd_drv_stop_ap(hapd); - hapd->started = 0; + hapd->beacon_set_done = 0; } } @@ -471,7 +471,6 @@ out: struct hostapd_data *hapd = iface->bss[i]; int ret; - hapd->started = 1; hapd->conf->start_disabled = 0; hostapd_set_freq(hapd, conf->hw_mode, iface->freq, conf->channel, -- 2.30.2