From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] eCryptfs: Regression in unencrypted filename symlinks
Date: Sat, 07 Feb 2009 10:09:23 -0600 [thread overview]
Message-ID: <1234022963.21124.0.camel@norville.austin.ibm.com> (raw)
In-Reply-To: <20090207000649.GA10560@boomer>
On Fri, 2009-02-06 at 18:06 -0600, Tyler Hicks wrote:
> The addition of filename encryption caused a regression in unencrypted
> filename symlink support. ecryptfs_copy_filename() is used when dealing
> with unencrypted filenames and it reported that the new, copied filename
> was a character longer than it should have been.
>
> This caused the return value of readlink() to count the NULL byte of the
> symlink target. Most applications don't care about the extra NULL byte,
> but a version control system (bzr) helped in discovering the bug.
>
> Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
> ---
> fs/ecryptfs/crypto.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
> index c01e043..f6caeb1 100644
> --- a/fs/ecryptfs/crypto.c
> +++ b/fs/ecryptfs/crypto.c
> @@ -1716,7 +1716,7 @@ static int ecryptfs_copy_filename(char **copied_name, size_t *copied_name_size,
> {
> int rc = 0;
>
> - (*copied_name) = kmalloc((name_size + 2), GFP_KERNEL);
> + (*copied_name) = kmalloc((name_size + 1), GFP_KERNEL);
> if (!(*copied_name)) {
> rc = -ENOMEM;
> goto out;
> @@ -1726,7 +1726,7 @@ static int ecryptfs_copy_filename(char **copied_name, size_t *copied_name_size,
> * in printing out the
> * string in debug
> * messages */
> - (*copied_name_size) = (name_size + 1);
> + (*copied_name_size) = name_size;
> out:
> return rc;
> }
--
David Kleikamp
IBM Linux Technology Center
prev parent reply other threads:[~2009-02-07 16:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-07 0:06 [PATCH] eCryptfs: Regression in unencrypted filename symlinks Tyler Hicks
2009-02-07 16:09 ` Dave Kleikamp [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=1234022963.21124.0.camel@norville.austin.ibm.com \
--to=shaggy@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tyhicks@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox