From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: Kalle Valo <kalle.valo@nokia.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] mac80211: validate SIOCSIWPOWER arguments better
Date: Tue, 06 Jan 2009 18:12:35 +0100 [thread overview]
Message-ID: <1231261955.3654.0.camel@johannes> (raw)
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;
next reply other threads:[~2009-01-06 17:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-06 17:12 Johannes Berg [this message]
2009-01-07 14:51 ` [PATCH] mac80211: validate SIOCSIWPOWER arguments better Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1231261955.3654.0.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=kalle.valo@nokia.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox