diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2015-11-20 15:57:15 -0800 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2016-02-15 17:07:47 +0100 |
commit | 8ffd304fd7a423ba1fe8819ac70785fb9ed46bab (patch) | |
tree | 29b343f1284cdb9a84b70760f671ee52721e758f /kernel | |
parent | 881aa623a5ffdb1b08f04a3d8af08905b64118c6 (diff) | |
download | lwn-8ffd304fd7a423ba1fe8819ac70785fb9ed46bab.tar.gz lwn-8ffd304fd7a423ba1fe8819ac70785fb9ed46bab.zip |
fat: fix fake_offset handling on error path
commit 928a477102c4fc6739883415b66987207e3502f4 upstream.
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.
[hirofumi@mail.parknet.co.jp: cleanup and make sure to correct fake_offset]
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Tested-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Richard Weinberger <richard.weinberger@gmail.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions