Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1441010

Re: [PATCH] vfs: check i_count under lock in evict_inodes

From David Chen <david.chen@osnexus.com>
Newsgroups linux.kernel
Subject Re: [PATCH] vfs: check i_count under lock in evict_inodes
Date 2016-07-12 03:40 +0200
Message-ID <rTUQ2-6xe-13@gated-at.bofh.it> (permalink)
References <rTTKh-5SH-5@gated-at.bofh.it> <rTU3E-607-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Al,

I'm not sure about the in-tree fs, but in zfsonlinux, it would offload
iput to a thread, so this would happen there. And it would wait for
the thread in put_super(), so that part is not a problem...

Thanks

2016-07-11 17:46 GMT-07:00 Al Viro <viro@zeniv.linux.org.uk>:
> On Mon, Jul 11, 2016 at 05:15:04PM -0700, Chunwei Chen wrote:
>> We need to check i_count again with i_lock held, because iput might re-add
>> i_count when lazytime is on. Without this check, we could end up with
>> double-free or use-after-free.
>
> Details, please.  Ideally - with a reproducer.  Who is calling that iput()
> at that point of generic_shutdown_super() (has to be another thread) and
> just what will happen if the same iput() is delayed until *after*
> evict_inodes(), all the way into ->put_super().  At which point there's
> no promise whatsoever that the data structures used by ->evict_inode()
> hadn't been already freed...
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] vfs: check i_count under lock in evict_inodes Chunwei Chen <david.chen@osnexus.com> - 2016-07-12 02:30 +0200
  Re: [PATCH] vfs: check i_count under lock in evict_inodes Al Viro <viro@ZenIV.linux.org.uk> - 2016-07-12 02:50 +0200
    Re: [PATCH] vfs: check i_count under lock in evict_inodes David Chen <david.chen@osnexus.com> - 2016-07-12 03:40 +0200
      Re: [PATCH] vfs: check i_count under lock in evict_inodes Christoph Hellwig <hch@infradead.org> - 2016-07-12 03:50 +0200
      Re: [PATCH] vfs: check i_count under lock in evict_inodes Al Viro <viro@ZenIV.linux.org.uk> - 2016-07-12 07:30 +0200

csiph-web