From: Richard Weinberger <richard@nod.at>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Vegard Nossum <vegard.nossum@oracle.com>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Endless getdents() in vfat filesystem
Date: Sat, 14 Nov 2015 16:06:03 +0100 [thread overview]
Message-ID: <56474DDB.7020904@nod.at> (raw)
In-Reply-To: <87r3js3baj.fsf@mail.parknet.co.jp>
Am 14.11.2015 um 15:28 schrieb OGAWA Hirofumi:
> Vegard Nossum <vegard.nossum@oracle.com> writes:
>
>> On 11/14/2015 11:32 AM, Richard Weinberger wrote:
>>> On Sat, Nov 14, 2015 at 2:19 AM, Vegard Nossum <vegard.nossum@oracle.com> wrote:
>>>> Hi,
>>>>
>>>> Using the attached disk image I observe that getdents() never returns
>>>> the end of the directory, i.e. mounting the disk image on a loopback
>>>> device and running 'ls' under strace shows an endless stream of:
>>>>
>>>> getdents(3, /* 2 entries */, 32768) = 48
>>>> getdents(3, /* 2 entries */, 32768) = 48
>>>> getdents(3, /* 2 entries */, 32768) = 48
>>>> ...
>>>
>>> Please more details. Is this image hand crafted?
>>> If not, how has it been created? Is is supposed to work?
>>
>> It was created by fuzzing, it is not supposed to work per se.
>>
>>> From a quick look it seems as the root directory is bad but we report
>>> progress in ->iterate.
>>> ctx->pos is 2, we set it back to 0, because of the faked dot entries.
>>> but fat_get_entry() did not make any progress and we report 0 back to VFS.
>>> So, VFS sees progress and the game continues.
>>>
>>> Does the attached patch help?
>>
>> Yes, it does fixes the problem here, but I can't really comment on the
>> correctness of the patch.
>>
>> Thanks for the quick reponse,
>
> I made cleanup and made sure fake_offset is corrected.
>
> Richard, Signed-off-by was missed in your patch, so I added. Can you
> agree to Signed-off-by?
Sure!
Thanks,
//richard
next prev parent reply other threads:[~2015-11-14 15:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-14 1:19 Endless getdents() in vfat filesystem Vegard Nossum
2015-11-14 10:32 ` Richard Weinberger
2015-11-14 12:42 ` Vegard Nossum
2015-11-14 14:28 ` OGAWA Hirofumi
2015-11-14 15:06 ` Richard Weinberger [this message]
2015-11-14 18:19 ` OGAWA Hirofumi
2015-11-15 11:05 ` Vegard Nossum
2015-11-15 11:24 ` Richard Weinberger
2015-11-15 12:59 ` OGAWA Hirofumi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56474DDB.7020904@nod.at \
--to=richard@nod.at \
--cc=akpm@linux-foundation.org \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=vegard.nossum@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox