[openwrt/openwrt] hostapd: fix crash on interface setup failure
LEDE Commits
lede-commits at lists.infradead.org
Mon Jul 8 12:17:26 PDT 2024
hauke pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/287e2565e2a4caccc8e04505585ba9e64b7e244b
commit 287e2565e2a4caccc8e04505585ba9e64b7e244b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jun 14 14:43:39 2024 +0200
hostapd: fix crash on interface setup failure
Add a missing NULL pointer check when deleting beacons
Signed-off-by: Felix Fietkau <nbd at nbd.name>
(cherry picked from commit 3984fb0582083c5c0f511ed3a33eb17908eccb08)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
...1-fix-crash-when-adding-an-interface-fails.patch | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/package/network/services/hostapd/patches/060-nl80211-fix-crash-when-adding-an-interface-fails.patch b/package/network/services/hostapd/patches/060-nl80211-fix-crash-when-adding-an-interface-fails.patch
new file mode 100644
index 0000000000..44ba6c009c
--- /dev/null
+++ b/package/network/services/hostapd/patches/060-nl80211-fix-crash-when-adding-an-interface-fails.patch
@@ -0,0 +1,21 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Fri, 14 Jun 2024 14:41:16 +0200
+Subject: [PATCH] nl80211: fix crash when adding an interface fails
+
+When adding an interface fails early, the bss link is still NULL.
+Avoid crashing on deleting beacons.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -3004,7 +3004,7 @@ static int wpa_driver_nl80211_del_beacon
+ struct nl_msg *msg;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+
+- if (!link->beacon_set)
++ if (!link || !link->beacon_set)
+ return 0;
+
+ wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
More information about the lede-commits
mailing list