]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ecryptfs_lookup_interpose(): lower_dentry->d_inode is not stable
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Nov 2019 18:45:04 +0000 (13:45 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 10 Nov 2019 16:57:44 +0000 (11:57 -0500)
commite72b9dd6a5f17d0fb51f16f8685f3004361e83d0
tree19a562a037fad18df276c5847f43b57b646da2dc
parentbcf0d9d4b76976f892154efdfc509b256fd898e8
ecryptfs_lookup_interpose(): lower_dentry->d_inode is not stable

lower_dentry can't go from positive to negative (we have it pinned),
but it *can* go from negative to positive.  So fetching ->d_inode
into a local variable, doing a blocking allocation, checking that
now ->d_inode is non-NULL and feeding the value we'd fetched
earlier to a function that won't accept NULL is not a good idea.

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ecryptfs/inode.c