linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	vegard.nossum@gmail.com, mingo@elte.hu
Subject: Re: [patch 07/21] fs: fix overflow in sys_mount() for in-kernel calls
Date: Wed, 23 Sep 2009 09:26:50 +0300	[thread overview]
Message-ID: <1253687210.4971.0.camel@penberg-laptop> (raw)
In-Reply-To: <20090921103408.GK5858@ZenIV.linux.org.uk>

On Mon, 2009-09-21 at 11:34 +0100, Al Viro wrote:
> On Fri, Sep 18, 2009 at 01:05:45PM -0700, akpm@linux-foundation.org wrote:
> > From: Vegard Nossum <vegard.nossum@gmail.com>
> > 
> > On 2009/6/17 Ingo Molnar <mingo@elte.hu> reported:
> > >
> > > btw., here's an old friend of a warning:
> > >
> 
> [snip]
> 
> > @@ -1640,7 +1640,7 @@ static int do_new_mount(struct path *pat
> >  {
> >  	struct vfsmount *mnt;
> >  
> > -	if (!type || !memchr(type, 0, PAGE_SIZE))
> > +	if (!type)
> >  		return -EINVAL;
> >  
> >  	/* we need capabilities... */
> > @@ -1871,6 +1871,23 @@ int copy_mount_options(const void __user
> >  	return 0;
> >  }
> 
> > @@ -1900,8 +1917,6 @@ long do_mount(char *dev_name, char *dir_
> >  
> >  	if (!dir_name || !*dir_name || !memchr(dir_name, 0, PAGE_SIZE))
> >  		return -EINVAL;
> > -	if (dev_name && !memchr(dev_name, 0, PAGE_SIZE))
> > -		return -EINVAL;
> >  
> >  	if (data_page)
> >  		((char *)data_page)[PAGE_SIZE - 1] = 0;
> 
> In this form it's simply b0rken - you need to take care of other do_mount()
> callers.  arch/alpha/kernel/osf_sys.c is safe, but fs/compat.c isn't...

Vegard, ping?


      reply	other threads:[~2009-09-23  6:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 20:05 [patch 07/21] fs: fix overflow in sys_mount() for in-kernel calls akpm
2009-09-21 10:34 ` Al Viro
2009-09-23  6:26   ` Pekka Enberg [this message]

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=1253687210.4971.0.camel@penberg-laptop \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=vegard.nossum@gmail.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).