linux-stable/fs/ecryptfs
Al Viro d47135249f ecryptfs_lookup_interpose(): lower_dentry->d_parent is not stable either
commit 762c69685f 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>
2019-11-20 17:59:32 +01:00
..
crypto.c eCryptfs: fix a couple type promotion bugs 2019-07-31 07:28:42 +02:00
debug.c
dentry.c eCryptfs: Invalidate dcache entries when lower i_nlink is zero 2015-08-18 17:29:48 -05:00
ecryptfs_kernel.h ecryptfs: fix dereference of NULL user_key_payload 2017-10-12 17:16:40 +01:00
file.c eCryptfs: don't pass up plaintext names when using filename encryption 2018-06-21 04:02:42 +09:00
inode.c ecryptfs_lookup_interpose(): lower_dentry->d_parent is not stable either 2019-11-20 17:59:32 +01:00
Kconfig
keystore.c ecryptfs: fix dereference of NULL user_key_payload 2017-10-12 17:16:40 +01:00
kthread.c scripts/spelling.txt: add "againt" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
main.c VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb) 2017-07-17 08:45:34 +01:00
Makefile
messaging.c eCryptfs: use after free in ecryptfs_release_messaging() 2017-11-30 08:40:45 +00:00
miscdev.c
mmap.c xattr: Add __vfs_{get,set,remove}xattr helpers 2016-10-07 20:10:44 -04:00
read_write.c fs: fix kernel_write prototype 2017-09-04 19:05:15 -04:00
super.c eCryptfs: Do not allocate hash tfm in NORECLAIM context 2016-04-20 17:50:01 +08:00