linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
	Jan Kara <jack@suse.cz>, Dmitry Monakhov <dmonakhov@openvz.org>,
	Jeff Moyer <jmoyer@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-aio@kvack.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH] aio: fix a user triggered use after free (and fix freeze protection of aio writes)
Date: Sun, 30 Oct 2016 11:52:31 +0100	[thread overview]
Message-ID: <20161030105231.GA16015@quack2.suse.cz> (raw)
In-Reply-To: <20161030094437.GA3225@quack2.suse.cz>

On Sun 30-10-16 10:44:37, Jan Kara wrote:
> On Sat 29-10-16 13:09:25, Linus Torvalds wrote:
> > On Sat, Oct 29, 2016 at 12:17 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > >
> > > AFAICS, the possibility of dropping the last reference to struct file
> > > before ->write_iter() has returned is fundamentally broken.  I might be
> > > missing something subtle here, but...
> > 
> > Ok, let's add a get_file(); fput(); around that whole iter call sequence.
> > 
> > And that's a separate issue from "we should hold the fs freezer lock
> > around the whole operation". So I think we need both.
> 
> Yup, these are two separate issues. I'm fine with adding get_file(); fput()
> around the iter call sequence. Then, when we have struct file available for
> the whole time ->write_iter runs, I'd prefer to keep the call to fool
> lockdep where original file_end_write() call was - that gives us proper
> lockdep coverage for all the code behind iter_op(). The downside is we
> cannot keep helpers as elegant as you suggested in your patch but I believe
> it's bearable and worth the additional lockdep coverage. I'll send patches
> shortly...

Hum, the additional refcount patch oopses on me when running generic/323,
I'll have to board to my flight to US shortly so I won't be able to send it
soon - maybe when I'm transferring in Denver ;).

								Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2016-10-30 10:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-29  7:44 aio: fix a user triggered use after free Christoph Hellwig
2016-10-29  7:44 ` [PATCH] aio: fix a user triggered use after free (and fix freeze protection of aio writes) Christoph Hellwig
2016-10-29 12:24   ` Al Viro
2016-10-29 15:20     ` Christoph Hellwig
2016-10-29 16:12       ` Al Viro
2016-10-29 16:29         ` Al Viro
2016-10-30  6:32         ` Christoph Hellwig
2016-10-29 17:47       ` Linus Torvalds
2016-10-29 18:52         ` Al Viro
2016-10-29 19:07           ` Linus Torvalds
2016-10-29 19:17             ` Al Viro
2016-10-29 20:09               ` Linus Torvalds
2016-10-30  9:44                 ` Jan Kara
2016-10-30 10:52                   ` Jan Kara [this message]
2016-10-30 15:58                     ` Christoph Hellwig
2016-10-30  6:29         ` Christoph Hellwig

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=20161030105231.GA16015@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --cc=hch@lst.de \
    --cc=jmoyer@redhat.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --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).