提交 30373dc0 编写于 作者: T Tim Gardner 提交者: Tyler Hicks

ecryptfs: Improve metadata read failure logging

Print inode on metadata read failure. The only real
way of dealing with metadata read failures is to delete
the underlying file system file. Having the inode
allows one to 'find . -inum INODE`.

[tyhicks@canonical.com: Removed some minor not-for-stable parts]
Signed-off-by: NTim Gardner <tim.gardner@canonical.com>
Reviewed-by: NKees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: NTyler Hicks <tyhicks@canonical.com>
上级 14094198
...@@ -1620,7 +1620,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry) ...@@ -1620,7 +1620,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode); rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode);
if (rc) { if (rc) {
printk(KERN_DEBUG "Valid eCryptfs headers not found in " printk(KERN_DEBUG "Valid eCryptfs headers not found in "
"file header region or xattr region\n"); "file header region or xattr region, inode %lu\n",
ecryptfs_inode->i_ino);
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
} }
...@@ -1629,7 +1630,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry) ...@@ -1629,7 +1630,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
ECRYPTFS_DONT_VALIDATE_HEADER_SIZE); ECRYPTFS_DONT_VALIDATE_HEADER_SIZE);
if (rc) { if (rc) {
printk(KERN_DEBUG "Valid eCryptfs headers not found in " printk(KERN_DEBUG "Valid eCryptfs headers not found in "
"file xattr region either\n"); "file xattr region either, inode %lu\n",
ecryptfs_inode->i_ino);
rc = -EINVAL; rc = -EINVAL;
} }
if (crypt_stat->mount_crypt_stat->flags if (crypt_stat->mount_crypt_stat->flags
...@@ -1640,7 +1642,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry) ...@@ -1640,7 +1642,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
"crypto metadata only in the extended attribute " "crypto metadata only in the extended attribute "
"region, but eCryptfs was mounted without " "region, but eCryptfs was mounted without "
"xattr support enabled. eCryptfs will not treat " "xattr support enabled. eCryptfs will not treat "
"this like an encrypted file.\n"); "this like an encrypted file, inode %lu\n",
ecryptfs_inode->i_ino);
rc = -EINVAL; rc = -EINVAL;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册