Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Latest commit 928a477 @OGAWAHirofumi OGAWAHirofumi committed with fat: fix fake_offset handling on error path
For the root directory, .  and ..  are faked (using dir_emit_dots()) and
ctx->pos is reset from 2 to 0.

A corrupted root directory could cause fat_get_entry() to fail, but
->iterate() (fat_readdir()) reports progress to the VFS (with ctx->pos
rewound to 0), so any following calls to ->iterate() continue to return
the same entries again and again.

The result is that userspace will never see the end of the directory,
causing e.g.  'ls' to hang in a getdents() loop.

[ cleanup and make sure to correct fake_offset]
Reported-by: Vegard Nossum <>
Tested-by: Vegard Nossum <>
Signed-off-by: Richard Weinberger <>
Signed-off-by: OGAWA Hirofumi <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
Failed to load latest commit information.
Makefile fat (exportfs): move NFS support code
cache.c fs/fat: remove unnecessary includes
dir.c fat: fix fake_offset handling on error path
fat.h fs/fat: comment fix, fat_bits can be also 32
fatent.c fs/fat: remove unnecessary includes
file.c writeback: separate out include/linux/backing-dev-defs.h
inode.c writeback: separate out include/linux/backing-dev-defs.h
misc.c fs/fat: remove unnecessary includes
namei_msdos.c Merge branch 'for-linus' of git://…
namei_vfat.c Merge branch 'for-linus' of git://…
nfs.c VFS: normal filesystems (and lustre): d_inode() annotations
Something went wrong with that request. Please try again.