linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/1 v2] rt2x00: fix "buffer size not provably correct" build warning
       [not found] <20100823210221.126521640@rtp-net.org>
@ 2010-08-23 21:02 ` Arnaud Patard
  2010-08-23 22:10   ` Ivo Van Doorn
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaud Patard @ 2010-08-23 21:02 UTC (permalink / raw)
  To: Ivo van Doorn; +Cc: Gertjan van Wingerde, linux-wireless

rt2x00 debugfs interface doesn't check the size of the data coming
from userspace, leading to a build warning. Fix That.

v2: return EINVAL if input is too long

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>

Index: rt2x00/drivers/net/wireless/rt2x00/rt2x00debug.c
===================================================================
--- rt2x00.orig/drivers/net/wireless/rt2x00/rt2x00debug.c	2010-08-23 18:03:31.414826113 +0200
+++ rt2x00/drivers/net/wireless/rt2x00/rt2x00debug.c	2010-08-23 20:37:24.894366547 +0200
@@ -480,6 +480,9 @@ static ssize_t rt2x00debug_write_##__nam
 	if (index >= debug->__name.word_count)			\
 		return -EINVAL;					\
 								\
+	if (length > sizeof(line))				\
+		return -EINVAL;					\
+								\
 	if (copy_from_user(line, buf, length))			\
 		return -EFAULT;					\
 								\



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

* Re: [patch 1/1 v2] rt2x00: fix "buffer size not provably correct" build warning
  2010-08-23 21:02 ` [patch 1/1 v2] rt2x00: fix "buffer size not provably correct" build warning Arnaud Patard
@ 2010-08-23 22:10   ` Ivo Van Doorn
  0 siblings, 0 replies; 2+ messages in thread
From: Ivo Van Doorn @ 2010-08-23 22:10 UTC (permalink / raw)
  To: Arnaud Patard; +Cc: Gertjan van Wingerde, linux-wireless, John W. Linville

T24gTW9uLCBBdWcgMjMsIDIwMTAgYXQgMTE6MDIgUE0sIEFybmF1ZCBQYXRhcmQKPGFybmF1ZC5w
YXRhcmRAcnRwLW5ldC5vcmc+IHdyb3RlOgo+IHJ0MngwMCBkZWJ1Z2ZzIG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gIKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoFwKPiArIKAgoCCgIGlmIChs
ZW5ndGggPiBzaXplb2YobGluZSkpIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgXAo+ICsg
oCCgIKAgoCCgIKAgoCByZXR1cm4gLUVJTlZBTDsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCBcCj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgoCCgIFwKPiCgIKAgoCCgaWYgKGNvcHlfZnJvbV91c2VyKGxpbmUsIGJ1Ziwg
bGVuZ3RoKSkgoCCgIKAgoCCgIKAgoCCgIKBcCj4goCCgIKAgoCCgIKAgoCCgcmV0dXJuIC1FRkFV
TFQ7IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgXAo+IKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoFwKPgo+Cj4K

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

end of thread, other threads:[~2010-08-23 22:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20100823210221.126521640@rtp-net.org>
2010-08-23 21:02 ` [patch 1/1 v2] rt2x00: fix "buffer size not provably correct" build warning Arnaud Patard
2010-08-23 22:10   ` Ivo Van Doorn

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).