[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m239fwfk4k.fsf@firstfloor.org>
Date: Fri, 16 Sep 2011 10:54:35 -0700
From: Andi Kleen <andi@...stfloor.org>
To: djwong@...ibm.com
Cc: "Theodore Ts'o" <tytso@....edu>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: Prevent stack overrun in ext4_file_open when recording last known mountpoint
"Darrick J. Wong" <djwong@...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@...ux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists