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:	Mon, 13 Oct 2014 00:58:05 +0400
From:	Dmitry Monakhov <dmonakhov@...nvz.org>
To:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH 1/2] ext4: Replace open coded mdata csum feature to helper function

Dmitry Monakhov <dmonakhov@...nvz.org> writes:
<Snim>
ext4_fill_super:
> -	if (EXT4_HAS_RO_COMPAT_FEATURE(sb,
> -				       EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) {
Oh Crap. Next two lines shows that I've not tested this patch with
metadata_csum enabled :( .Please ignore this version. I'll send updated version.
> +	if (ext4_has_metadata_csum(sb)) {
>  		sbi->s_chksum_driver = crypto_alloc_shash("crc32c", 0, 0);

>  		if (IS_ERR(sbi->s_chksum_driver)) {
>  			ext4_msg(sb, KERN_ERR, "Cannot load crc32c driver.");
> @@ -3508,8 +3501,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	}
>  
>  	/* Precompute checksum seed for all metadata */
> -	if (EXT4_HAS_RO_COMPAT_FEATURE(sb,
> -			EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
> +	if (ext4_has_metadata_csum(sb))
>  		sbi->s_csum_seed = ext4_chksum(sbi, ~0, es->s_uuid,
>  					       sizeof(es->s_uuid));
>  
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 42823ab..1e09fc7 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -142,8 +142,7 @@ static int ext4_xattr_block_csum_verify(struct inode *inode,
>  					sector_t block_nr,
>  					struct ext4_xattr_header *hdr)
>  {
> -	if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
> -		EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&
> +	if (ext4_has_metadata_csum(inode->i_sb) &&
>  	    (hdr->h_checksum != ext4_xattr_block_csum(inode, block_nr, hdr)))
>  		return 0;
>  	return 1;
> @@ -153,8 +152,7 @@ static void ext4_xattr_block_csum_set(struct inode *inode,
>  				      sector_t block_nr,
>  				      struct ext4_xattr_header *hdr)
>  {
> -	if (!EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
> -		EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
> +	if (!ext4_has_metadata_csum(inode->i_sb))
>  		return;
>  
>  	hdr->h_checksum = ext4_xattr_block_csum(inode, block_nr, hdr);
> -- 
> 1.7.1
>
> --
> 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

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists