kernel-hacking-2024-linux-s.../fs/ecryptfs
Ryusuke Konishi df06846416 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>
2007-08-22 19:52:44 -07:00
..
crypto.c
debug.c
dentry.c
ecryptfs_kernel.h eCryptfs: fix write zeros behavior 2007-06-28 11:34:53 -07:00
file.c sendfile: remove .sendfile from filesystems that use generic_file_sendfile() 2007-07-10 08:04:13 +02:00
inode.c eCryptfs: fix lookup error for special files 2007-08-22 19:52:44 -07:00
keystore.c
main.c eCryptfs: fix error handling in ecryptfs_init 2007-08-11 15:47:40 -07:00
Makefile
messaging.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
mmap.c fix some conversion overflows 2007-07-20 08:44:19 -07:00
netlink.c
super.c