android_kernel_samsung_a7y1.../fs/ecryptfs
Al Viro 582a2501ef 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>
2020-04-07 12:26:27 +02:00
..
crypto.c eCryptfs: fix a couple type promotion bugs 2020-04-06 20:04:55 +02:00
debug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dentry.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecryptfs_dek.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecryptfs_dek.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecryptfs_dlp.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecryptfs_kernel.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecryptfs_sdp_chamber.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecryptfs_sdp_chamber.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode.c ecryptfs_lookup_interpose(): lower_dentry->d_parent is not stable either 2020-04-07 12:26:27 +02:00
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
keystore.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kthread.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
main.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
messaging.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
miscdev.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mm.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mmap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
read_write.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
super.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30