All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com>,
	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: Tue, 05 Oct 2010 11:09:55 -0700	[thread overview]
Message-ID: <4CAB69F3.7030309@zytor.com> (raw)
In-Reply-To: <20101005165159.GQ19804@ZenIV.linux.org.uk>

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);

... would work for me.

OK, not an issue...

	-hpa

  reply	other threads:[~2010-10-05 18:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05  8:44 [PATCH 0/1] initramfs: strcpy destination string overflow 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 [this message]
2010-10-06  8:58         ` Evgeny Kuznetsov

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=4CAB69F3.7030309@zytor.com \
    --to=hpa@zytor.com \
    --cc=EXT-Eugeny.Kuznetsov@nokia.com \
    --cc=akpm@linux-foundation.org \
    --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 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.