mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
fs/ntfs3: Break dir enumeration if directory contents error
commit 302e9dca8428979c9c99f2dbb44dc1783f5011c3 upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c494fe4ccd
commit
8f54c5f3c6
@@ -475,6 +475,7 @@ static int ntfs_readdir(struct file *file, struct dir_context *ctx)
|
||||
vbo = (u64)bit << index_bits;
|
||||
if (vbo >= i_size) {
|
||||
ntfs_inode_err(dir, "Looks like your dir is corrupt");
|
||||
ctx->pos = eod;
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user