From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Roel Kluin <roel.kluin@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fat: Read buffer overflow
Date: Sat, 08 Aug 2009 19:18:01 +0900 [thread overview]
Message-ID: <877hxeobhi.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <87prb6pqdu.fsf@devron.myhome.or.jp> (OGAWA Hirofumi's message of "Sat, 08 Aug 2009 19:10:53 +0900")
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:
> Pekka Enberg <penberg@cs.helsinki.fi> writes:
>
>> Yes, but we pass "ulen" to vfat_is_used_badchars(). The value of
>> "ulen" is a returned in the "longlen" argument of xlate_to_uni() which
>> in turn is calculated as follows for the UTF-8 case:
>>
>> int name_len = strlen(name);
>> *outlen = utf8s_to_utf16s(name, PATH_MAX, (wchar_t *) outname);
>> *outlen -= (name_len - len);
>> *longlen = *outlen;
>>
>> Maybe "*outlen" can never be negative because of some invariants that
>> I don't see but it's so non-obvious to me that I'd like to see the
>> explicit check in vfat_is_used_badchars().
>
> Ah, good point. Sorry, I was looking my tree. I'm going to submit the
> attached patch on next merge window.
>
> Is this enough for it?
BTW, if we want the sanity check of "longlen", I'd like to put it in the
end of xlate_to_uni(), not vfat_is_used_badchars(). Because I think it's
job of xlate_to_uni().
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2009-08-08 10:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-07 22:48 [PATCH] fat: Read buffer overflow Roel Kluin
2009-08-07 23:06 ` OGAWA Hirofumi
2009-08-08 6:56 ` Pekka Enberg
2009-08-08 10:10 ` OGAWA Hirofumi
2009-08-08 10:12 ` Pekka Enberg
2009-08-08 10:18 ` OGAWA Hirofumi [this message]
[not found] <d6Gqb-2HX-3@gated-at.bofh.it>
2009-08-08 13:01 ` Alexander Koeppe
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=877hxeobhi.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=roel.kluin@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.