mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
ntfs3: fix boundary check in ntfs_dir_count()
ntfs_dir_emit() skips index entries whose fname does not fit in e->size, but ntfs_dir_count() still accepted them via de_get_fname() alone. dir_is_empty() can then disagree with readdir: a malformed directory appears empty in ls while rmdir fails with ENOTEMPTY. Factor the fname/key bounds check into de_fname_fits() and use it from ntfs_dir_emit() and de_countable_fname() so count/readdir share the same entry acceptance rules. Signed-off-by: Xixin Liu <liuxixin@kylinos.cn> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
2064bc663f
commit
71a25f2593
1 changed files with 25 additions and 7 deletions
Loading…
Add table
Add a link
Reference in a new issue