diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2007-08-10 16:00:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-11 18:47:40 -0400 |
commit | 202a21d6914369c1362f1ab50f0cbe92b9c38718 (patch) | |
tree | a7e6ac7518008bb3992361d849d921224cd0ccab /fs/ecryptfs | |
parent | 60c9834238482f805b1d9e4dc2a780405ddab80f (diff) |
eCryptfs: fix lookup error for special files
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r-- | 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 0a50942b4378..131954b3fb98 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, | |||
353 | ecryptfs_printk(KERN_DEBUG, "Is a symlink; returning\n"); | 353 | ecryptfs_printk(KERN_DEBUG, "Is a symlink; returning\n"); |
354 | goto out; | 354 | goto out; |
355 | } | 355 | } |
356 | if (special_file(lower_inode->i_mode)) { | ||
357 | ecryptfs_printk(KERN_DEBUG, "Is a special file; returning\n"); | ||
358 | goto out; | ||
359 | } | ||
356 | if (!nd) { | 360 | if (!nd) { |
357 | ecryptfs_printk(KERN_DEBUG, "We have a NULL nd, just leave" | 361 | ecryptfs_printk(KERN_DEBUG, "We have a NULL nd, just leave" |
358 | "as we *think* we are about to unlink\n"); | 362 | "as we *think* we are about to unlink\n"); |