public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: djwong@us.ibm.com
Cc: "Theodore Ts'o" <tytso@mit.edu>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: Prevent stack overrun in ext4_file_open when recording last known mountpoint
Date: Fri, 16 Sep 2011 10:54:35 -0700	[thread overview]
Message-ID: <m239fwfk4k.fsf@firstfloor.org> (raw)
In-Reply-To: <20110915231645.GE12086@tux1.beaverton.ibm.com> (Darrick J. Wong's message of "Thu, 15 Sep 2011 16:16:45 -0700")

"Darrick J. Wong" <djwong@us.ibm.com> writes:


> Writing stack variables into the superblock doesn't sound like a great idea, so
> use strncpy instead.

This means you can end up with a non 0 terminated path in the
superblock, which could confuse programs.

Better use strlcpy()

strncpy is usually a bad idea, it's semantics overall are quite
bogus and it's also inefficient because it always fills.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

  reply	other threads:[~2011-09-16 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15 23:16 [PATCH] ext4: Prevent stack overrun in ext4_file_open when recording last known mountpoint Darrick J. Wong
2011-09-16 17:54 ` Andi Kleen [this message]
2011-09-16 18:40   ` [PATCH v2] " Darrick J. Wong
2011-09-30 19:46     ` Darrick J. Wong
2011-10-04 11:30       ` Lukas Czerner

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=m239fwfk4k.fsf@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=djwong@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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