mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Halcrow <mhalcrow@us.ibm.com>
To: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	ecryptfs-devel@lists.sourceforge.net,
	moriai.satoshi@lab.ntt.co.jp, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.23-rc1] eCryptfs: fix lookup error for special files
Date: Wed, 1 Aug 2007 09:57:40 -0500	[thread overview]
Message-ID: <20070801145740.GF30416@halcrow.austin.ibm.com> (raw)
In-Reply-To: <200708011301.AA00221@paprika.lab.ntt.co.jp>

On Wed, Aug 01, 2007 at 10:01:14PM +0900, Ryusuke Konishi wrote:
> When ecryptfs_lookup() is called against special files, eCryptfs
> generates the following errors because it tries to treat them like
> regular eCryptfs files.
> 
> Error opening lower file for lower_dentry [0xffff810233a6f150], lower_mnt [0xffff810235bb4c80], and flags 
> [0x8000]
> Error opening lower_file to read header region
> Error attempting to read the [user.ecryptfs] xattr from the lower file; return value = [-95]
> Valid metadata not found in header region or xattr region; treating file as unencrypted
> 
> For instance, the problem can be reproduced by the steps below.
> 
>   # mkdir /root/crypt /mnt/crypt
>   # mount -t ecryptfs /root/crypt /mnt/crypt
>   # mknod /mnt/crypt/c0 c 0 0
>   # umount /mnt/crypt
>   # mount -t ecryptfs /root/crypt /mnt/crypt
>   # ls -l /mnt/crypt
> 
> This patch fixes it by adding a check similar to directories and
> symlinks.
> 
> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>

Acked-by: Michael Halcrow <mhalcrow@us.ibm.com>

> ---
>  fs/ecryptfs/inode.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
> index 0a50942..131954b 100644
> --- a/fs/ecryptfs/inode.c
> +++ b/fs/ecryptfs/inode.c
> @@ -353,6 +353,10 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
>  		ecryptfs_printk(KERN_DEBUG, "Is a symlink; returning\n");
>  		goto out;
>  	}
> +	if (special_file(lower_inode->i_mode)) {
> +		ecryptfs_printk(KERN_DEBUG, "Is a special file; returning\n");
> +		goto out;
> +	}
>  	if (!nd) {
>  		ecryptfs_printk(KERN_DEBUG, "We have a NULL nd, just leave"
>  				"as we *think* we are about to unlink\n");

           reply	other threads:[~2007-08-01 14:58 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200708011301.AA00221@paprika.lab.ntt.co.jp>]

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=20070801145740.GF30416@halcrow.austin.ibm.com \
    --to=mhalcrow@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=ecryptfs-devel@lists.sourceforge.net \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moriai.satoshi@lab.ntt.co.jp \
    /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®