]> git.baikalelectronics.ru Git - kernel.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)
commit0d2b397dc3f6b371805c71e01f69c7115b6e20b0
tree19a562a037fad18df276c5847f43b57b646da2dc
parentfe4b98e2e5942be0de6eb10c49fa709a5bf7ca0d
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