[PATCH 6.6.y] wifi: cfg80211: release locks on error in cfg80211_wext_siwgenie()
From: Wentao Guan
Date: Sat Oct 10 2026 - 00:31:19 EST
This error path returns while both wiphy_lock() and wdev_lock() are still
held, so one malformed IE request can permanently block later operations
on this wiphy. Route the error through out to release both locks.
Fixes: d01f1600e8b0 ("wifi: cfg80211: validate IEs in cfg80211_wext_siwgenie()")
Signed-off-by: Wentao Guan <guanwentao@xxxxxxxxxxxxx>
---
net/wireless/wext-sme.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index cfa903eb0e82f..0e7c314bdeef0 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -354,8 +354,10 @@ int cfg80211_wext_siwgenie(struct net_device *dev,
/* nothing */
}
- if (!for_each_element_completed(elem, extra, ie_len))
- return -EINVAL;
+ if (!for_each_element_completed(elem, extra, ie_len)) {
+ err = -EINVAL;
+ goto out;
+ }
ie = kmemdup(extra, ie_len, GFP_KERNEL);
if (!ie) {
--
2.39.5