lkml.org 
[lkml]   [2016]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vfs: check i_count under lock in evict_inodes
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...

\
 
 \ /
  Last update: 2016-07-12 03:21    [W:0.495 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site