2014-01-09 15:46:30

by Ujjal Roy

[permalink] [raw]
Subject: [PATCH] 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 <[email protected]>
---
net/wireless/wext-compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 051d961..5661a54 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;

--
1.8.1.4



2014-01-21 06:37:58

by Ujjal Roy

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: add sanity check for retry limit in wext-compat

Johannes Berg <johannes@...> writes:

> Sure, applied. You'd probably be better off just turning off wext
> though :)
>

Sorry!



2014-01-09 16:05:53

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: add sanity check for retry limit in wext-compat

On Thu, 2014-01-09 at 21:16 +0530, Ujjal Roy wrote:
> Block setting the wrong values through iwconfig retry
> command. Add sanity checking before sending the retry
> limit to the driver.

Sure, applied. You'd probably be better off just turning off wext
though :)

johannes