From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753622Ab2CCVHq (ORCPT ); Sat, 3 Mar 2012 16:07:46 -0500 Received: from mail.parknet.co.jp ([210.171.160.6]:53347 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753427Ab2CCVHl (ORCPT ); Sat, 3 Mar 2012 16:07:41 -0500 From: OGAWA Hirofumi To: Namjae Jeon Cc: linux-kernel@vger.kernel.org, Ravishankar N , Andrew Morton Subject: Re: [PATCH 2/2] fat: Fix bug in enforcing Long File Name length. References: <1330737405-7129-1-git-send-email-linkinjeon@gmail.com> <878vjhv1t7.fsf@devron.myhome.or.jp> Date: Sun, 04 Mar 2012 06:07:39 +0900 In-Reply-To: <878vjhv1t7.fsf@devron.myhome.or.jp> (OGAWA Hirofumi's message of "Sun, 04 Mar 2012 05:59:00 +0900") Message-ID: <87wr71tmuc.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OGAWA Hirofumi writes: > Namjae Jeon writes: > >> Since '*outlen' is initialized to zero,it is currently possible to >> create a f ilename of length (FAT_LFN_LEN +1) when utf8 is not >> enabled.To enforce the FA T_LFN_LEN limit, we must perform one less >> iteration. > > Acked-by: OGAWA Hirofumi Please forward this too. >> Signed-off-by: Namjae Jeon >> Signed-off-by: Ravishankar N >> --- >> fs/fat/namei_vfat.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c >> index aae3b4e..98ae804 100644 >> --- a/fs/fat/namei_vfat.c >> +++ b/fs/fat/namei_vfat.c >> @@ -522,7 +522,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, >> op = &outname[*outlen * sizeof(wchar_t)]; >> } else { >> for (i = 0, ip = name, op = outname, *outlen = 0; >> - i < len && *outlen <= FAT_LFN_LEN; >> + i < len && *outlen < FAT_LFN_LEN; >> *outlen += 1) { >> if (escape && (*ip == ':')) { >> if (i > len - 5) -- OGAWA Hirofumi