From: Tom Rini <trini@kernel.crashing.org>
To: silvio.cesare@hushmail.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.18 bugs
Date: Fri, 26 Jul 2002 11:44:03 -0700 [thread overview]
Message-ID: <20020726184403.GA1389@opus.bloom.county> (raw)
In-Reply-To: <200207251902.g6PJ2bc01956@mailserver4.hushmail.com>
On Thu, Jul 25, 2002 at 12:02:37PM -0700, silvio.cesare@hushmail.com wrote:
> below are a few bugs leading to reading kernel memory using some of the usb
> drivers.
[snip]
> static int se401_set_size(struct usb_se401 *se401, int width, int height)
[snip]
> width / height can be modified (to a negative for instance) - something
> might break though with this though --> (will check more later).
Well, it's easy enough to check for this tho. How does the following
look? Jeroen?
> static long se401_read(struct video_device *dev, char *buf, unsigned long count, int noblock)
[snip]
> if (realcount > se401->cwidth*se401->cheight*3)
> realcount=se401->cwidth*se401->cheight*3;
>
> [ skip ]
>
> if (copy_to_user(buf, se401->frame[0].data, realcount))
> return -EFAULT;
>
> sign and overflow problem, leading to unbounded copy_to_user.
But since width and height are bouned (by the max the camera supports,
and w/ the following by the min) isn't this problem impossible to hit,
without some additional breakage ?
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
Index: se401.c
===================================================================
RCS file: /cvsdev/mvl-kernel/linux/drivers/usb/se401.c,v
retrieving revision 1.2
diff -u -u -r1.2 se401.c
--- se401.c 2002/06/17 17:30:22 1.2
+++ se401.c 2002/07/26 17:43:18
@@ -699,11 +699,11 @@
/* Check for a valid mode */
if (!width || !height)
return 1;
if ((width & 1) || (height & 1))
return 1;
- if (width>se401->width[se401->sizes-1])
+ if ((width>se401->width[se401->sizes-1]) || (width<se401->width[0]))
return 1;
- if (height>se401->height[se401->sizes-1])
+ if ((height>se401->height[se401->sizes-1]) || (height<se401->width[0]))
return 1;
/* Stop a current stream and start it again at the new size */
next prev parent reply other threads:[~2002-07-26 18:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-25 19:02 2.4.18 bugs silvio.cesare
2002-07-26 18:44 ` Tom Rini [this message]
2002-07-26 23:38 ` Greg KH
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=20020726184403.GA1389@opus.bloom.county \
--to=trini@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=silvio.cesare@hushmail.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