[lkml]   [2016]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] aio: fix a user triggered use after free (and fix freeze protection of aio writes)
On Sat 29-10-16 13:09:25, Linus Torvalds wrote:
> On Sat, Oct 29, 2016 at 12:17 PM, Al Viro <> 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


Jan Kara <>

 \ /
  Last update: 2016-10-30 10:45    [W:0.078 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site