ntfs: avoid misclassifying directory reparse points
Hyunchul Lee
maintainerPATCH 1/1 ntfs: avoid misclassifying directory reparse points
Windows directory symlinks and junctions can carry FILE_ATTR_DUP_FILE_NAME_INDEX_PRESENT in their entry while the reparse flag is stored only in. The old directory enumeration path treated such entries as DT_DIR, allowing no-follow userspace scanners to recurse through symlink targets.
Signed-off-by Hyunchul Lee <[email protected]>
--- fs/ntfs/dir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/ntfs/dir.c +3 -3
@@ -635,11 +635,11 @@ static inline int ntfs_filldir(struct ntfs_volume *vol, } mref =MREF_LE (ie->data.dir.indexed_file); -if (ie->key.file_name.file_attributes & +if (ie->key.file_name.file_attributes &FILE_ATTR_REPARSE_POINT ) + dt_type =ntfs_reparse_tag_dt_types (vol, mref); +else if (ie->key.file_name.file_attributes &FILE_ATTR_DUP_FILE_NAME_INDEX_PRESENT ) dt_type =DT_DIR ; -else if (ie->key.file_name.file_attributes &FILE_ATTR_REPARSE_POINT ) - dt_type =ntfs_reparse_tag_dt_types (vol, mref);else dt_type =DT_REG ;
Signature · 1 line
2.43.0
Quoted 8 lines · Hyunchul Lee
Windows directory symlinks and junctions can carry
FILE_ATTR_DUP_FILE_NAME_INDEX_PRESENTin their entry while the reparse flag is stored only in. The old directory enumeration path treated such entries asDT_DIR, allowing no-follow userspace scanners to recurse through symlink targets.Signed-off-by Hyunchul Lee <[email protected]>
Applied it to #ntfs-next.
Thanks!