All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Ken Ashcraft <kash@stanford.edu>
Cc: linux-kernel@vger.kernel.org, mc@cs.Stanford.EDU,
	Linus Torvalds <torvalds@transmeta.com>
Subject: Re: [CHECKER] Probable Security Errors in 2.4.12-ac3
Date: Tue, 23 Oct 2001 09:32:30 +0200	[thread overview]
Message-ID: <20011023093230.I638@suse.de> (raw)
In-Reply-To: <Pine.GSO.4.33.0110202220470.963-100000@saga5.Stanford.EDU>
In-Reply-To: <Pine.GSO.4.33.0110202220470.963-100000@saga5.Stanford.EDU>

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

On Sat, Oct 20 2001, Ken Ashcraft wrote:
> ---------------------------------------------------------
> [BUG] needs upper bound
> /home/kash/linux/2.4.12/drivers/cdrom/cdrom.c:2019:mmc_ioctl: ERROR:RANGE:2012:2019: [LOOP] Looping on user length "nr" set by 'copy_from_user':2018 [linkages -> 2018:nr=nframes -> 2012:ra:start] [distance=26]
> 			lba = ra.addr.lba;
> 		else
> 			return -EINVAL;
> 
> 		/* FIXME: we need upper bound checking, too!! */
> Start --->
> 		if (lba < 0 || ra.nframes <= 0)
> 			return -EINVAL;
> 
> 		/*
> 		 * start with will ra.nframes size, back down if alloc fails
> 		 */
> 		nr = ra.nframes;
> Error --->
> 		do {
> 			cgc.buffer = kmalloc(CD_FRAMESIZE_RAW * nr, GFP_KERNEL);
> 			if (cgc.buffer)
> 				break;

Here's a fix for that. Linus, please apply.

-- 
Jens Axboe


[-- Attachment #2: cd-cdda-1 --]
[-- Type: text/plain, Size: 316 bytes --]

--- drivers/cdrom/cdrom.c~	Tue Oct 23 09:28:35 2001
+++ drivers/cdrom/cdrom.c	Tue Oct 23 09:29:23 2001
@@ -2009,7 +2009,7 @@
 			return -EINVAL;
 
 		/* FIXME: we need upper bound checking, too!! */
-		if (lba < 0 || ra.nframes <= 0)
+		if (lba < 0 || ra.nframes <= 0 || ra.nframes > 64)
 			return -EINVAL;
 
 		/*

  parent reply	other threads:[~2001-10-23  7:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-21  5:28 [CHECKER] Probable Security Errors in 2.4.12-ac3 Ken Ashcraft
2001-10-21  8:08 ` Manfred Spraul
2001-10-21  9:01   ` Ken Ashcraft
2001-10-23  7:32 ` Jens Axboe [this message]
2001-10-25  1:59 ` Rusty Russell

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=20011023093230.I638@suse.de \
    --to=axboe@suse.de \
    --cc=kash@stanford.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.Stanford.EDU \
    --cc=torvalds@transmeta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.