diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-06-12 00:29:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-16 13:44:09 -0700 |
commit | 4e358517b2810788777196f038f5a0b3b9936a6a (patch) | |
tree | 214101c3428567015ac6fb33226a7e29122cdad6 /lib/timerqueue.c | |
parent | d3c8656bc29be81894dc78a300c37b84d281ec03 (diff) |
lock_parent: don't step on stale ->d_parent of all-but-freed one
commit c2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 upstream.
Dentry that had been through (or into) __dentry_kill() might be seen
by shrink_dentry_list(); that's normal, it'll be taken off the shrink
list and freed if __dentry_kill() has already finished. The problem
is, its ->d_parent might be pointing to already freed dentry, so
lock_parent() needs to be careful.
We need to check that dentry hasn't already gone into __dentry_kill()
*and* grab rcu_read_lock() before dropping ->d_lock - the latter makes
sure that whatever we see in ->d_parent after dropping ->d_lock it
won't be freed until we drop rcu_read_lock().
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/timerqueue.c')
0 files changed, 0 insertions, 0 deletions