Skip to content

Commit 302e9dc

Browse files
fs/ntfs3: Break dir enumeration if directory contents error
If we somehow attempt to read beyond the directory size, an error is supposed to be returned. However, in some cases, read requests do not stop and instead enter into a loop. To avoid this, we set the position in the directory to the end. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> Cc: stable@vger.kernel.org
1 parent 05afeee commit 302e9dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ntfs3/dir.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ static int ntfs_readdir(struct file *file, struct dir_context *ctx)
475475
vbo = (u64)bit << index_bits;
476476
if (vbo >= i_size) {
477477
ntfs_inode_err(dir, "Looks like your dir is corrupt");
478+
ctx->pos = eod;
478479
err = -EINVAL;
479480
goto out;
480481
}

0 commit comments

Comments
 (0)