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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <504420DE.1040206@tao.ma>
Date:	Mon, 03 Sep 2012 11:15:42 +0800
From:	Tao Ma <tm@....ma>
To:	linux-ext4@...r.kernel.org
CC:	"Darrick J. Wong" <djwong@...ibm.com>,
	Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH] e2fsprogs/csum: Use fs.csum_seed for xattr block csum
 calculation.

Hi Ted,
	As the corresponding kernel change has been merged, can this patch be
merged to the e2fsporgs also?

Thanks
Tao
On 06/24/2012 10:22 PM, Tao Ma wrote:
> From: Tao Ma <boyu.mt@...bao.com>
> 
> As I mentioned in the kernel part patch with the subject
> "ext4: Use s_csum_seed instead of i_csum_seed for xattr block csum",
> it is not easy for the kernel to use the proper inode csum seed.
> So always use the fs.csum_seed for the xattr block csum calculation.
> 
> Cc: Darrick J. Wong <djwong@...ibm.com>
> Cc: "Theodore Ts'o" <tytso@....edu>
> Signed-off-by: Tao Ma <boyu.mt@...bao.com>
> ---
>  lib/ext2fs/csum.c |   18 +++---------------
>  1 files changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c
> index a7096d2..5ccbc1c 100644
> --- a/lib/ext2fs/csum.c
> +++ b/lib/ext2fs/csum.c
> @@ -119,21 +119,9 @@ static errcode_t ext2fs_ext_attr_block_csum(ext2_filsys fs, ext2_ino_t inum,
>  	struct ext2_inode inode;
>  
>  	hdr->h_checksum = 0;
> -	if (ext2fs_le32_to_cpu(hdr->h_refcount) != 1) {
> -		block = ext2fs_cpu_to_le64(block);
> -		*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&block,
> -					sizeof(block));
> -	} else {
> -		retval = ext2fs_read_inode(fs, inum, &inode);
> -		if (retval)
> -			return retval;
> -		inum = ext2fs_cpu_to_le32(inum);
> -		gen = ext2fs_cpu_to_le32(inode.i_generation);
> -		*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&inum,
> -					sizeof(inum));
> -		*crc = ext2fs_crc32c_le(*crc, (unsigned char *)&gen,
> -					sizeof(gen));
> -	}
> +	block = ext2fs_cpu_to_le64(block);
> +	*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&block,
> +				sizeof(block));
>  	*crc = ext2fs_crc32c_le(*crc, (unsigned char *)buf, fs->blocksize);
>  	hdr->h_checksum = old_crc;
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ