public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jack Steiner <steiner@sgi.com>
To: Michael Buesch <mb@bu3sch.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Jiri Kosina <jkosina@suse.cz>,
	Michael Gilbert <michael.s.gilbert@gmail.com>,
	linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: CVE-2009-2584
Date: Thu, 5 Nov 2009 12:16:28 -0600	[thread overview]
Message-ID: <20091105181628.GA2239@sgi.com> (raw)
In-Reply-To: <200911051847.36103.mb@bu3sch.de>

On Thu, Nov 05, 2009 at 06:47:33PM +0100, Michael Buesch wrote:
> On Thursday 05 November 2009 18:38:21 Linus Torvalds wrote:
> > @@ -161,14 +161,15 @@ static int options_show(struct seq_file *s, void *p)
> >  static ssize_t options_write(struct file *file, const char __user *userbuf,
> >  			     size_t count, loff_t *data)
> >  {
> > -	unsigned long val;
> > -	char buf[80];
> > +	char buf[16];
> >  
> > -	if (strncpy_from_user(buf, userbuf, sizeof(buf) - 1) < 0)
> > +	if (count >= sizeof(buf))
> > +		return -EINVAL;
> > +	if (copy_from_user(buf, userbuf, count))
> >  		return -EFAULT;
> > -	buf[count - 1] = '\0';
> > -	if (!strict_strtoul(buf, 10, &val))
> > -		gru_options = val;
> > +	buf[count] = '\0';
> > +	if (strict_strtoul(buf, 0, &gru_options))
> > +		return -EINVAL;
> >  
> >  	return count;
> >  }
> > 
> > 
> 
> Looks OK to me. I can't test it however, as I don't own the hardware.

"buf" should be larger than 16. The string could be "0x" + 16 characters.

I'll verify the the rest.


We have the hardware :-)


--- jack

  reply	other threads:[~2009-11-05 18:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04 22:05 CVE-2009-2584 Michael Gilbert
2009-11-04 22:08 ` CVE-2009-2584 Justin P. Mattock
2009-11-04 22:21   ` CVE-2009-2584 Michael Gilbert
2009-11-04 22:49     ` CVE-2009-2584 Justin P. Mattock
2009-11-05 15:27 ` CVE-2009-2584 Jiri Kosina
2009-11-05 16:32   ` CVE-2009-2584 Linus Torvalds
2009-11-05 17:38     ` CVE-2009-2584 Linus Torvalds
2009-11-05 17:47       ` CVE-2009-2584 Linus Torvalds
2009-11-05 17:47       ` CVE-2009-2584 Michael Buesch
2009-11-05 18:16         ` Jack Steiner [this message]
2009-11-05 18:22           ` CVE-2009-2584 Linus Torvalds
2009-11-05 18:41             ` CVE-2009-2584 Jack Steiner
2009-11-05 18:19         ` CVE-2009-2584 Linus Torvalds
2009-11-05 17:56       ` CVE-2009-2584 Roland Dreier

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=20091105181628.GA2239@sgi.com \
    --to=steiner@sgi.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=michael.s.gilbert@gmail.com \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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