linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: validate SIOCSIWPOWER arguments better
@ 2009-01-06 17:12 Johannes Berg
  2009-01-07 14:51 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2009-01-06 17:12 UTC (permalink / raw)
  To: John Linville; +Cc: Kalle Valo, linux-wireless

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>
---
 net/mac80211/wext.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- wireless-testing.orig/net/mac80211/wext.c	2009-01-06 18:10:07.000000000 +0100
+++ wireless-testing/net/mac80211/wext.c	2009-01-06 18:10:23.000000000 +0100
@@ -852,9 +852,12 @@ static int ieee80211_ioctl_siwpower(stru
 		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;
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-07 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-06 17:12 [PATCH] mac80211: validate SIOCSIWPOWER arguments better Johannes Berg
2009-01-07 14:51 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).