* [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
* Re: [PATCH] mac80211: validate SIOCSIWPOWER arguments better
2009-01-06 17:12 [PATCH] mac80211: validate SIOCSIWPOWER arguments better Johannes Berg
@ 2009-01-07 14:51 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2009-01-07 14:51 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
Johannes Berg <johannes@sipsolutions.net> writes:
> Don't accept any arguments we don't handle,
Makes sense to me. wrq->disabled case is not checked because of the
ugly goto, but at least for me that looks ok.
> and return error codes instead of using an uninitialised stack
> value.
You refer to ps variable here, right? Yeah, I wrote that. Sorry.
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
--
Kalle Valo
^ 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).