diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-11-03 21:55:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-20 19:59:32 +0300 |
commit | d47135249f4d1e8d29e514986a63bf129c64276c (patch) | |
tree | a75e5a1bf88ea14e6b1ad6b329953e10f3d88555 /include | |
parent | dc39d4f7ecbd4176b4e358c8caf9b8f18c8f8e24 (diff) | |
download | linux-d47135249f4d1e8d29e514986a63bf129c64276c.tar.xz |
ecryptfs_lookup_interpose(): lower_dentry->d_parent is not stable either
commit 762c69685ff7ad5ad7fee0656671e20a0c9c864d upstream.
We need to get the underlying dentry of parent; sure, absent the races
it is the parent of underlying dentry, but there's nothing to prevent
losing a timeslice to preemtion in the middle of evaluation of
lower_dentry->d_parent->d_inode, having another process move lower_dentry
around and have its (ex)parent not pinned anymore and freed on memory
pressure. Then we regain CPU and try to fetch ->d_inode from memory
that is freed by that point.
dentry->d_parent *is* stable here - it's an argument of ->lookup() and
we are guaranteed that it won't be moved anywhere until we feed it
to d_add/d_splice_alias. So we safely go that way to get to its
underlying dentry.
Cc: stable@vger.kernel.org # since 2009 or so
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions