linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Alexander Holler <holler@ahsoftware.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: [git pull] gadgetfs fixes
Date: Sun, 15 Mar 2015 01:39:49 +0000	[thread overview]
Message-ID: <20150315013948.GU29656@ZenIV.linux.org.uk> (raw)
In-Reply-To: <5504D4B9.2010901@ahsoftware.de>

On Sun, Mar 15, 2015 at 01:39:21AM +0100, Alexander Holler wrote:
> Am 13.03.2015 um 17:42 schrieb Al Viro:
> > 	Assorted fixes around AIO on gadgetfs: leaks, use-after-free,
> > troubles caused by ->f_op flipping.  Please, pull from
> > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git gadget
> > 
> > Shortlog:
> > Al Viro (8):
> >       new helper: dup_iter()
> >       move iov_iter.c from mm/ to lib/
> >       gadget/function/f_fs.c: close leaks
> >       gadget/function/f_fs.c: use put iov_iter into io_data
> >       gadget/function/f_fs.c: switch to ->{read,write}_iter()
> 
> >       gadgetfs: use-after-free in ->aio_read()
> 
> If that patch ends up in the stable kernels (as it is marked as such),
> it needs a
> 	value = -ENOMEM
> before that added "goto fail;", otherwise the return value is unitialized.

Umm...  If I'm not misparsing what you said, you are talking about the
one that gets removed by
-       if (iv) {
-               priv->iv = kmemdup(iv, nr_segs * sizeof(struct iovec),
-                                  GFP_KERNEL);
-               if (!priv->iv) {
-                       kfree(priv);
-                       goto fail;
-               }
-       }
in "gadget: switch ep_io_operations to ->read_iter/->write_iter" very
shortly afterwards, and _that_ is a prereq for ->f_op flipping fixes,
which is also clear -stable fodder.  But yes, it's a bisect hazard and
a cherry-pick one as well.  Nice catch...

  reply	other threads:[~2015-03-15  1:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 16:42 [git pull] gadgetfs fixes Al Viro
2015-03-15  0:39 ` Alexander Holler
2015-03-15  1:39   ` Al Viro [this message]
     [not found]     ` <20150315013948.GU29656-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2015-03-15  6:35       ` Alexander Holler
2015-03-15  8:17         ` Al Viro
2015-03-15  8:31           ` Alexander Holler
2015-03-16 10:11             ` Alexander Holler
2015-03-15  8:50           ` Alexander Holler
2015-03-15  9:09             ` 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=20150315013948.GU29656@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=holler@ahsoftware.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.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;
as well as URLs for NNTP newsgroup(s).