Quellcode durchsuchen

cfg80211: add sanity check for retry limit in wext-compat

Block setting the wrong values through iwconfig retry
command. Add sanity checking before sending the retry
limit to the driver.

Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ujjal Roy vor 11 Jahren
Ursprung
Commit
f5aa0d21dd
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      net/wireless/wext-compat.c

+ 1 - 1
net/wireless/wext-compat.c

@@ -370,7 +370,7 @@ static int cfg80211_wext_siwretry(struct net_device *dev,
 	u8 oshort = wdev->wiphy->retry_short;
 	u8 oshort = wdev->wiphy->retry_short;
 	int err;
 	int err;
 
 
-	if (retry->disabled ||
+	if (retry->disabled || retry->value < 1 || retry->value > 255 ||
 	    (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
 	    (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
 		return -EINVAL;
 		return -EINVAL;