]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: use dget_parent() in ext4_file_open()
authorMiklos Szeredi <mszeredi@redhat.com>
Sat, 26 Mar 2016 20:14:41 +0000 (16:14 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 26 Mar 2016 20:14:41 +0000 (16:14 -0400)
commit048aa92d4046508e2ef0edac3397dcc157171ceb
tree2f70946530b1e90ab39560b206827e460c1444d5
parentbe33ea31ec6c57b0fc14fc037083482eee9ac0d1
ext4: use dget_parent() in ext4_file_open()

In f_op->open() lock on parent is not held, so there's no guarantee that
parent dentry won't go away at any time.

Even after this patch there's no guarantee that 'dir' will stay the parent
of 'inode', but at least it won't be freed while being used.

Fixes: 30a65257bc84 ("ext4 crypto: move context consistency check to ext4_file_open()")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: <stable@vger.kernel.org> # v4.5
fs/ext4/file.c