From: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com>
To: "ext H. Peter Anvin" <hpa@zytor.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
akpm@linux-foundation.org, phillip@lougher.demon.co.uk,
hsweeten@visionengravers.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] initramfs: strcpy destination string overflow
Date: Wed, 06 Oct 2010 12:58:21 +0400 [thread overview]
Message-ID: <1286355501.24366.92.camel@ekuznets-lx-nokia> (raw)
In-Reply-To: <4CAB69F3.7030309@zytor.com>
On Tue, 2010-10-05 at 11:09 -0700, ext H. Peter Anvin wrote:
> On 10/05/2010 09:51 AM, Al Viro wrote:
> >
> > Take a look at struct hash definition. That sizeof is PATH_MAX and
> > do_header() will reject an entry with name longer than that. IOW,
> > the whole thing is a non-issue; we can add
> > if (strlen(name) >= PATH_MAX)
> > BUG();
> > if we really care, but that's it.
> >
> > As a side note, it looks like we need a fat warning about blind "improvements"
> > of that kind in CodingStyle; cargo-cult replacements like that can easily
> > hide real bugs... ;-/
>
> BUG_ON(strlen(name) >= PATH_MAX);
Should it be:
BUG_ON(strlen(name) >= N_ALIGN(PATH_MAX));
-Evgeny
>
> ... would work for me.
>
> OK, not an issue...
>
> -hpa
prev parent reply other threads:[~2010-10-06 9:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 8:44 [PATCH 0/1] " Evgeny Kuznetsov
2010-10-05 8:44 ` [PATCH 1/1] " Evgeny Kuznetsov
2010-10-05 11:44 ` Américo Wang
2010-10-05 15:55 ` Linus Torvalds
2010-10-05 16:00 ` H. Peter Anvin
2010-10-05 16:51 ` Al Viro
2010-10-05 18:09 ` H. Peter Anvin
2010-10-06 8:58 ` Evgeny Kuznetsov [this message]
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=1286355501.24366.92.camel@ekuznets-lx-nokia \
--to=ext-eugeny.kuznetsov@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=phillip@lougher.demon.co.uk \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/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
all inboxes | Powered by JetHome®