From: Ujjal Roy Date: Thu, 9 Jan 2014 15:46:14 +0000 (+0530) Subject: cfg80211: add sanity check for retry limit in wext-compat X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f5aa0d21dd5ada040ff42b4d40357285e4ace441;p=linux-beck.git 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 Signed-off-by: Johannes Berg --- diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 051d961d4e28..5661a54ac7ee 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -370,7 +370,7 @@ static int cfg80211_wext_siwretry(struct net_device *dev, u8 oshort = wdev->wiphy->retry_short; int err; - if (retry->disabled || + if (retry->disabled || retry->value < 1 || retry->value > 255 || (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) return -EINVAL;