linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
To: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>,
	linux-wireless@vger.kernel.org
Subject: [patch 1/1] rt2x00: fix "buffer size not provably correct" build warning
Date: Mon, 23 Aug 2010 00:37:11 +0200	[thread overview]
Message-ID: <20100822223718.431624390@rtp-net.org> (raw)
In-Reply-To: 20100822223710.865969746@rtp-net.org

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

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 00:21:42.637941244 +0200
+++ rt2x00/drivers/net/wireless/rt2x00/rt2x00debug.c	2010-08-23 00:33:41.237941022 +0200
@@ -480,6 +480,8 @@ static ssize_t rt2x00debug_write_##__nam
 	if (index >= debug->__name.word_count)			\
 		return -EINVAL;					\
 								\
+	if (length > sizeof(line))				\
+		length = sizeof(line);				\
 	if (copy_from_user(line, buf, length))			\
 		return -EFAULT;					\
 								\



       reply	other threads:[~2010-08-22 22:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100822223710.865969746@rtp-net.org>
2010-08-22 22:37 ` Arnaud Patard [this message]
2010-08-23  9:38   ` [patch 1/1] rt2x00: fix "buffer size not provably correct" build warning Ivo Van Doorn

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=20100822223718.431624390@rtp-net.org \
    --to=arnaud.patard@rtp-net.org \
    --cc=IvDoorn@gmail.com \
    --cc=gwingerde@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).