Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbbKNPGL (ORCPT ); Sat, 14 Nov 2015 10:06:11 -0500 Received: from a.ns.miles-group.at ([95.130.255.143]:11949 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbbKNPGH (ORCPT ); Sat, 14 Nov 2015 10:06:07 -0500 Subject: Re: Endless getdents() in vfat filesystem To: OGAWA Hirofumi References: <56468C1E.2060401@oracle.com> <56472C2F.5090207@oracle.com> <87r3js3baj.fsf@mail.parknet.co.jp> Cc: Vegard Nossum , LKML , Andrew Morton From: Richard Weinberger Message-ID: <56474DDB.7020904@nod.at> Date: Sat, 14 Nov 2015 16:06:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <87r3js3baj.fsf@mail.parknet.co.jp> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1741 Lines: 48 Am 14.11.2015 um 15:28 schrieb OGAWA Hirofumi: > Vegard Nossum writes: > >> On 11/14/2015 11:32 AM, Richard Weinberger wrote: >>> On Sat, Nov 14, 2015 at 2:19 AM, Vegard Nossum 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/