forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
ksmbd: fix racy issue from using ->d_parent and ->d_name
Al pointed out that ksmbd has racy issue from using ->d_parent and ->d_name in ksmbd_vfs_unlink and smb2_vfs_rename(). and he suggested changing from the way it start with dget_parent(), which can cause retry loop and unexpected errors, to find the parent of child, lock it and then look for a child in locked directory. This patch introduce a new helper(vfs_path_parent_lookup()) to avoid out of share access and export vfs functions like the following ones to use vfs_path_parent_lookup() and filename_parentat(). - __lookup_hash(). - getname_kernel() and putname(). - filename_parentat() Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
- Loading branch information
1 parent
555f3d7
commit f4cb65c1c670f5332092a7eb75d569bbd4e46a5f
Showing
8 changed files
with
272 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.