public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] fix for potential integer overflow in zoran driver
Date: Tue, 13 Apr 2004 22:17:02 +0100	[thread overview]
Message-ID: <20040413211702.GJ6051@redhat.com> (raw)
In-Reply-To: <200404132107.i3DL7tdA013238@hera.kernel.org>

On Mon, Apr 12, 2004 at 10:02:37PM +0000, Linux Kernel wrote:
 > ChangeSet 1.2126, 2004/04/12 15:02:37-07:00, akpm@osdl.org
 > 
 > 	[PATCH] fix for potential integer overflow in zoran driver
 > 	
 > 	From: "Ronald S. Bultje" <R.S.Bultje@students.uu.nl>
 > 	
 > 	Attached patch fixes a potential integer overflow in zoran_procs.c (part of
 > 	the zr36067 driver).  Bug was detected by Ken Ashcraft with the Stanford
 > 	checker.
 > 
 > --- a/drivers/media/video/zoran_procfs.c	Tue Apr 13 14:07:59 2004
 > +++ b/drivers/media/video/zoran_procfs.c	Tue Apr 13 14:07:59 2004
 > @@ -204,6 +204,10 @@
 >  	char *line, *ldelim, *varname, *svar, *tdelim;
 >  	struct zoran *zr;
 >  
 > +	/* Random maximum */
 > +	if (count > 256)
 > +		return -EINVAL;
 > +
 >  	zr = (struct zoran *) data;
 >  
 >  	string = sp = vmalloc(count + 1);

2.4 already had this fixed, but uses a somewhat larger value to clip at.
For uniformity sake, perhaps they should be the same ?
Patch below makes it match 2.4-bk

		Dave


--- bk-linus/drivers/media/video/zoran_procfs.c~	2004-04-13 22:15:35.000000000 +0100
+++ bk-linus/drivers/media/video/zoran_procfs.c	2004-04-13 22:15:58.000000000 +0100
@@ -204,8 +204,7 @@
 	char *line, *ldelim, *varname, *svar, *tdelim;
 	struct zoran *zr;
 
-	/* Random maximum */
-	if (count > 256)
+	if (count > 32768)	/* Stupidity filter */
 		return -EINVAL;
 
 	zr = (struct zoran *) data;

           reply	other threads:[~2004-04-13 21:17 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200404132107.i3DL7tdA013238@hera.kernel.org>]

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=20040413211702.GJ6051@redhat.com \
    --to=davej@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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