summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-01-06 18:12:35 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:55 -0500
commite9aeabaeb9a0bece50100dc74bbd720a68cb8f5c (patch)
tree4e3a5ba61805a5169ecede23af67240a6121c4f3
parent4797938c5dfa22af30fd16679192972f878419a1 (diff)
mac80211: validate SIOCSIWPOWER arguments better
Don't accept any arguments we don't handle, and return error codes instead of using an uninitialised stack value. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/wext.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 5690c3d41e7..3fc1b903bfb 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -853,9 +853,12 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
ps = true;
break;
default: /* Otherwise we ignore */
- break;
+ return -EINVAL;
}
+ if (wrq->flags & ~(IW_POWER_MODE | IW_POWER_TIMEOUT))
+ return -EINVAL;
+
if (wrq->flags & IW_POWER_TIMEOUT)
timeout = wrq->value / 1000;