lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 12 Jan 2012 13:02:25 +0100
From:	Tyler Hicks <tyler.hicks@...onical.com>
To:	Tim Gardner <tim.gardner@...onical.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH 2/2] ecryptfs: Print inode on metadata error

On 2012-01-11 18:00:42, Tim Gardner wrote:
> If a lower file system file is corrupted, then ecryptfs prints
> a generic and mostly useless log message when attempting to
> read metadata. Print the inode associated with the file
> so that a user can do something about it, e.g.,
> 
> find -inum INODE_NUM
> 
> Cc: linux-kernel@...r.kernel.org
> Cc: stable@...r.kernel.org
> Cc: Tyler Hicks <tyler.hicks@...onical.com>
> Signed-off-by: Tim Gardner <tim.gardner@...onical.com>
> ---

This looks good to me. I'll get it applied. Thanks!

Tyler

>  fs/ecryptfs/crypto.c |   14 +++++++++-----
>  1 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
> index ac063bd..affad0c 100644
> --- a/fs/ecryptfs/crypto.c
> +++ b/fs/ecryptfs/crypto.c
> @@ -1612,8 +1612,9 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
>  	rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size,
>  				 ecryptfs_inode);
>  	if (rc < 0) {
> -		printk(KERN_ERR "%s: Could not read %u bytes\n",
> -			__func__, crypt_stat->extent_size);
> +		printk(KERN_ERR "%s: Could not read %zu bytes, inode %lu\n",
> +			__func__, crypt_stat->extent_size,
> +			ecryptfs_inode->i_ino);
>  		goto out;
>  	}
>  
> @@ -1625,7 +1626,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
>  		rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode);
>  		if (rc) {
>  			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;
>  			goto out;
>  		}
> @@ -1634,7 +1636,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
>  						ECRYPTFS_DONT_VALIDATE_HEADER_SIZE);
>  		if (rc) {
>  			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;
>  		}
>  		if (crypt_stat->mount_crypt_stat->flags
> @@ -1645,7 +1648,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
>  			       "crypto metadata only in the extended attribute "
>  			       "region, but eCryptfs was mounted without "
>  			       "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;
>  		}
>  	}
> -- 
> 1.7.8.3
> 

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ