The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Jiri Kosina <jikos@jikos.cz>
Cc: Tomas M <tomas@slax.org>, linux-kernel@vger.kernel.org
Subject: Re: [patch] [bugfix] loop.c
Date: Fri, 23 Mar 2007 15:51:15 +0100	[thread overview]
Message-ID: <20070323155115.89f86b3b.dada1@cosmosbay.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703231522200.5030@twin.jikos.cz>

On Fri, 23 Mar 2007 15:25:23 +0100 (CET)
Jiri Kosina <jikos@jikos.cz> wrote:

> On Fri, 23 Mar 2007, Eric Dumazet wrote:
> 
> > -	if (max_loop < 1 || max_loop > 256) {
> > -		printk(KERN_WARNING "loop: invalid max_loop (must be between"
> > -				    " 1 and 256), using default (8)\n");
> > +	if (max_loop < 1) {
> > +		printk(KERN_WARNING "loop: invalid max_loop (must be > 1)"
> > +				    ", using default (8)\n");
> >  		max_loop = 8;
> >  	}
> [...]
> > +	loop_dev = kmalloc(max_loop * sizeof(struct loop_device *), GFP_KERNEL);
> > +	if (!loop_dev) {
> > +		loop_dev = vmalloc(max_loop * sizeof(struct loop_device *));
> > +		if (!loop_dev)
> > +			goto out_mem;
> > +		loop_dev_vmalloced = 1;
> >  	}
> 
> Why did you remove the upper bound check for max_loop value? Now you 
> effectively allow to max_loop * sizeof(struct loop_device *) to overflow, 
> when passed value of max_loop which is large enough. Or am I just blind?

Yes, I forgot to change this, but the new limit was 16384 in my mind

MODULE_PARM_DESC(max_loop, "Maximum number of loop devices (1-16384)");


  reply	other threads:[~2007-03-23 14:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23 14:04 [patch] [bugfix] loop.c Tomas M
2007-03-23 14:18 ` Jiri Kosina
2007-03-23 14:19 ` Eric Dumazet
2007-03-23 14:25   ` Jiri Kosina
2007-03-23 14:51     ` Eric Dumazet [this message]
2007-03-23 19:50       ` Michael Tokarev
2007-03-23 23:18         ` Jiri Kosina
2007-03-23 14:33   ` William Lee Irwin III
2007-03-23 14:36   ` Al Viro
2007-03-23 14:48     ` Eric Dumazet
2007-03-23 14:56       ` Al Viro
2007-03-23 14:41 ` Christoph Hellwig
2007-03-23 14:49   ` Al Viro

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=20070323155115.89f86b3b.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomas@slax.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